Professional Documents
Culture Documents
Entity Relationship (E-R) Modeling
Entity Relationship (E-R) Modeling
Entity Relationship (E-R) Modeling
Chapter 3
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 2
3
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 3
3
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 4
3
Degrees of Abstraction
• Conceptual
– Global view of data
– Basis for identification and description of main
data items
– ERD used to represent conceptual data model
– Hardware and software independent
• Internal
– Representation of database as seen by DBMS
– Adapts conceptual model to specific DBMS
– Software dependent
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 5
3
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 6
3
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 7
3
Attributes
• Characteristics of entities
• Domain is set of possible values
• Primary keys underlined
Figure 3.6
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 8
3
Attributes (con’t.)
• Simple • Multi-valued
– Cannot be subdivided – Can have many values
– Age, sex, marital status
– Person may have
• Composite several college degrees
– Can be subdivided into
additional attributes
• Derived
– Address into street, city, zip – Can be derived with
• Single-valued algorithm
– Can have only a single – Age can be derived
value from date of birth
– Person has one social
security number
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 9
3
Relationships
• Association between entities
• Connected entities are called participants
• Operate in both directions
• Connectivity describes relationship classification
– 1:1, 1:M, M:N
• Cardinality
– Expresses number of entity occurrences
associated with one occurrence of related entity
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 10
3
Figure 3.12
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 11
3
Relationship Strength
• Existence dependence
– Entity’s existence depends on existence of related entities
– Existence-independent entities can exist apart from related
entities
– EMPLOYEE claims DEPENDENT
• Weak (non-identifying)
– One entity is existence-independent on another
– PK of related entity doesn’t contain PK component of
parent entity
• Strong (identifying)
– One entity is existence-dependent on another
– PK of related entity contains PK component of parent
entity
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 12
3
Relationship Participation
• Optional
– Entity occurrence does not require a
corresponding occurrence in related entity
– Shown by drawing a small circle on side of
optional entity on ERD
• Mandatory
– Entity occurrence requires corresponding
occurrence in related entity
– If no optionality symbol is shown on ERD, it is
mandatory
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 13
3
Weak Entity
• Existence-dependent on another entity
• Has primary key that is partially or totally
derived from parent entity
Figure 3.19
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 14
3
Relationship Degree
• Indicates number of associated entities
• Unary
– Single entity
– Recursive
– Exists between occurrences of same entity set
• Binary
– Two entities associated
• Ternary
– Three entities associated
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 15
3
Figure 3.21
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 16
3
Composite Entities
• Used to ‘bridge’ between M:N relationships
• Bridge entities composed of primary keys of each
entity needing connection
Figure 3.30
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 17
3
Figure 3.31
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 18
3
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 19
3
Figure 3.35
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 20
3
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 21
3
Figure 3.36
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 22
3
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 23
3
Supertype/Subtype Relationship in an
ERD
Figure 3.42
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 24
3
Figure 3.43
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 25
3
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 26
3
Fourth and Fifth ERD
Segments Established
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 27
3
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 28
3
Eighth ERD
Segment Established
Figures 3.50
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 29
3
Ninth ERD
Segment Established
Figures 3.51
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 30
3
Table 3.2
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 31
3
Completed ERD
Figure 3.52
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 32
3
Challenge of Database Design:
Conflicting Goals
• Database must be designed to conform to design
standards
• High-speed processing may require design
compromises
• Quest for timely information may be the focus of
database design
• Other concerns
– Security
– Performance
– Shared access
– Integrity
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 33