Documente Academic
Documente Profesional
Documente Cultură
Chapter 12
ENTITY-RELATIONSHIP MODELING
Chapter Objectives
• How to use Entity–Relationship (ER) modeling in database design.
• The basic concepts associated with the ER model: entities,
relationships, and attributes.
• A diagrammatic technique for displaying an ER model using the
Unified Modeling Language
(UML).
• How to identify and resolve problems with ER models called
connection traps.
ER diagram of Branch user views of DreamHome
Concepts of the ER Model
•Entity types (Rectangles)
•Relationship types (Links)
•Attributes (Names inside rectangles)
Entity Type
“A group of objects with the same properties, which are identified by
the enterprise as having an independent existence.”
Entity occurrence:
A uniquely identifiable object of an entity type
ER diagram of Staff and Branch entity types
Relationship Types
Relationship type:
◦ Meaningful associations among entity types.
◦ i.e., Link between classes
◦ Name occurs as label on the link
◦ Arrow indicates direction of relationship type
Relationship occurrence:
◦ Uniquely identifiable association, which includes one occurrence
from each participating entity type.
◦ i.e., Link between instances
ER diagram of Branch Has Staff
relationship type
Relationship Types
Degree of a Relationship
◦ Number of participating entities in relationship.
Relationship of degree :
◦ A relationship of degree two is called binary
◦ A relationship of degree three is ternary
◦ A relationship of degree four is quaternary.
Binary relationship called POwns
Ternary relationship called Registers
(add diamond instead of label)
Quaternary relationship called Arranges
(add diamond instead of label)
Relationship Types
Recursive Relationship:
◦ Relationship type where same entity type participates more than
once in different roles.