Lecture 2 Data Model
Lecture 2 Data Model
TRANSPORT
DEPARTMEN
T
CCT
R . Mero
Prepared
By:
10/02/2023
Dat
e:
Introduction
Database Systems 2
Data Modeling and Data Models
• Data models
– Relatively simple representations of complex
real-world data structures
• Often graphical
• Model: an abstraction of a real-world object or
event
– Useful in understanding complexities of the
real-world environment
• Data modeling is iterative and progressive
Database Systems 3
The Importance of Data Models
Database Systems 4
Database Systems 5
Database Systems 6
Data Model Basic Building Blocks
• Entity: anything about which data are to be
collected and stored
• Attribute: a characteristic of an entity
• Relationship: describes an association among
entities
– One-to-many (1:M) relationship
– Many-to-many (M:N or M:M) relationship
– One-to-one (1:1) relationship
• Constraint: a restriction placed on the data
Database Systems 7
Business Rules
• Data becomes meaningful only when it reflects properly
defined business rules.
• Business Rule is a Descriptions of policies, procedures,
or principles within a specific organization
– It Apply to any organization that stores and uses data
to generate information
• Derived from Description of operations to create/enforce
actions within an organization’s environment
– Must be in writing and kept up to date
– Must be easy to understand and widely disseminated
• Describe characteristics of data as viewed by the
company
Database Systems 8
Discovering Business Rules
Database Systems 9
Discovering Business Rules (cont’d.)
• The process of identifying and documenting
business rules is essential to database
design for several reasons:
– Standardize company’s view of data
– Communications tool between users and
designers
– Allow designer to understand the nature, role,
and scope of data
– Allow designer to understand business
processes
– Allow designer to develop appropriate
relationship participation rules and constraints
Database Systems 10
Translating Business Rules into
Data Model Components
• Nouns translate into entities
• Verbs translate into relationships among entities
• Relationships are bidirectional
• Two questions to identify the relationship type:
– How many instances of B are related to one
instance of A?
– How many instances of A are related to one
instance of B?
Database Systems 11
1
2
Database Systems 12
1
3
Database Systems 15
The Entity Relationship Model
Database Systems 16
The Entity Relationship Model
(cont’d.)
• Entity instance (or occurrence) is row in table
• Entity set is collection of like entities
• Connectivity labels types of relationships
• Relationships are expressed using Chen
notation
– Relationships are represented by a diamond
– Relationship name is written inside the
diamond
Database Systems 17
Database Systems 18