You are on page 1of 19

Lecture6

Data Design
Data Design Concepts
• Data Structures
– Each file or table
contains data about
people, places, things or
events that interact with
the information system.
– File-oriented system
– Database management
system (DBMS)

2
File-oriented system

Mario’s shop uses two separate systems, so certain data must be entered
twice. This redundancy is inefficient and can produce errors. 3
Data Design Concepts
• Overview of File
Processing
– File processing can be
efficient and cost-effective
in certain situations.
– Potential problems
• Data redundancy
• Data integrity
• Rigid (solid) data structure.

4
Data Design Concepts
• The Evolution from File
Systems to Database Systems
– A database management
system (DBMS) is a collection of
tools, features, and interfaces
that enables users to add,
update, manage, access, and
analyze the contents of a
database.
– The main advantage of a DBMS
is that it offers timely,
interactive, and flexible data
access.
5
Data Design Concepts
• The Evolution from File Systems to Database Systems
– Some Advantages
• Scalability
• Better support for client/server systems
• Economy of scale.
• Flexible data sharing.
• Enterprise-wide application – database
administrator (DBA)
• Stronger standards: standards for data names,
formats, and documentation.
• Better security.
• Data independence. 6
DBMS Components
• Interfaces for Users, Database
Administrators, and Related
Systems.
– Users
• Query language: allows a user to
specify a task without specifying
how the task will be
accomplished.
• Query by example (QBE)
• SQL (structured query language)
– Database Administrators
• A DBA is responsible for DBMS
management and support.

7
DBMS Components (cont.)
– Related information systems
• A DBMS can support several related
information systems that provide input to, and
require specific data from, the DBMS.
• No human intervention is required for two-way
communication.

8
DBMS Components (cont.)
• Data Manipulation Language
– A data manipulation language (DML) controls
database operations, including storing, retrieving,
updating, and deleting data.
• Schema
– The complete definition of a database, including
descriptions of all fields, tables, and relationships,
is called a schema.
– You also can define one or more subschemas.

9
DBMS Components (cont.)
• Physical Data Repository
– The data dictionary is transformed into a physical data
repository, which also contains the schema and
subschemas.
– The physical repository might be centralized, or
distributed at several locations.
– ODBC – open database connectivity: is an industry-
standard protocol that makes it possible for software
from different vendors to interact and exchange data.
– JDBC – Java database connectivity: enables Java
applications to exchange data with any database that
uses SQL statements and is JDBC-compliant.
10
Web-Based Database Design
• Characteristics of Web-Based Design

11
Web-Based Database Design
• Connecting a Database to the
Web
– Database must be connected to
the Internet or intranet
– Middleware: translates the
retrieved data into an HTML
page that can be sent by the
web server and displayed by the
user’s browser
• Data Security
– Well-designed systems provide
security at three levels: the
database itself, the Web server,
and the telecommunication
links that connect the
components of the system 12
Data Design Terminology
• Definitions
– Entity: an entity is a person,
place, thing, or event for which
data is collected and
maintained.
– Table or file: contains a set of
related records that store data
about a specific entity
– Field: is a single characteristic
or fact about an entity
– Record (Tuple): is a set of
related fields that describes
one instance.
13
Data Design Terminology
• Key Fields
– Primary key: is a field or combination of fields that
uniquely and minimally identifies a particular
member of an entity.
– Candidate key: Sometimes there is a choice of fields
or field combinations to use as the primary key. the
field that contains the least amount of data and is
the easiest to use should be selected.
– Foreign key
– Secondary key: is a field or combination of fields
that can be used to access or retrieve records.
14
Data Design Terminology
• Referential Integrity
– Validity checks can help
avoid data input errors.
– In a relational database,
referential integrity means
that a foreign key value
cannot be entered in one
table unless it matches an
existing primary key in
another table.
– Orphan (‫)يتيم‬:Without
referential integrity, there
might be an order called
an orphan, because it had
no related customer.
15
Entity-Relationship Diagrams
• Drawing an ERD
– The first step is to list the
entities that you identified
during the fact-finding
process and to consider the
nature of the relationships
that link them.
– A popular method is to
represent entities as
rectangles and
relationships as diamond
shapes

16
Entity-Relationship Diagrams
• Types of Relationships
– Three types of
relationships can exist
between entities
– One-to-one relationship
(1:1)
– One-to-many
relationship (1:M)
– Many-to-many
relationship (M:N)

17
Entity-Relationship Diagrams
• Cardinality
• Cardinality notation
• Crow’s foot notation
• Unified Modeling
Language (UML)
• Now that you
understand database
elements and their
relationships, you can
start designing tables

18
19

You might also like