Database Systems:
Design, Implementation,
and Management, 14e
Dr Lucy Nwosu
Chapter 4:
Entity Relationship (ER) Modeling
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 1
Chapter Objectives
By the end of this chapter, you should be able to:
1. Identify the main characteristics of entity relationship components
2. Describe how relationships between entities are defined
3. Explain how ERD components affect database design and implementation
4. Describe how real-world database design often requires the reconciliation of
conflicting goals
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 2
The Entity Relationship Model
• The entity relationship model (ERM) forms the basis of an ERD
− The ERD represents the conceptual database as viewed by the end user
• ERDs depict the database’s main components:
− Entities
− Attributes
− Relationships
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 3
Entities
• An entity is an object of interest to the end user
− An entity refers to the entity set and not to a single entity occurrence
• An entity in the ERM corresponds to a table—not to a row—in the relational
environment
− ERM refers to a table row as an entity instance or entity occurrence
• In Chen, Crow’s Foot, and UML notations, an entity is represented by a rectangle that
contains the entity’s name
− The entity name, a noun, is usually written in all capital letters
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 4
Attributes (1 of 4)
• Attributes are characteristics of entities
• A required attribute is an attribute that must have a value and cannot be left empty
• An optional attribute does not require a value and can be left empty
• Attributes must have a domain, which is the set of possible values for a given
attribute
• An identifier is one or more attributes that uniquely identify each entity instance
• A composite identifier is a primary key composed of more than one attribute
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 5
Attributes (2 of 4)
• A composite attribute is an attribute that can be subdivided to yield additional
attributes
• A simple attribute is an attribute that cannot be subdivided
• A single-valued attribute is an attribute that has only a single value
• Multivalued attributes are attributes that have many values
• Implementing multivalued attributes
− Create several new attributes, one for each component of the original multivalued
attribute
− Create a new entity composed of the original multivalued attribute’s components
• A derived attribute is an attribute whose value is calculated from other attributes
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 6
Attributes (3 of 4)
• Figure 4.1 The Attributes
of the STUDENT Entity:
Chen and Crow’s Foot
• Figure 4.3 A
Multivalued Attribute in
An Entity
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 7
Attributes (4 of 4)
• Figure 4.4 Splitting the
Multivalued Attribute into
New Attributes
• Figure 4.6 Depiction of a
Derived Attribute
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 8
Relationships
• The entities that participate in a relationship are also known as participants and each
relationship is identified by a name that describes the relationship
• The relationship name is an active or passive verb
• Relationships between entities always operate in both directions
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 9
Connectivity and Cardinality (1 of 2)
• Connectivity describes the relationship classification
− Includes 1:1, 1:M, and M:N
• Cardinality expresses the minimum and maximum number of entity occurrences
associated with one occurrence of the related entity
− In the ERD, cardinality is indicated by placing the appropriate numbers beside the
entities, using the format (x,y)
− The first value represents the minimum number of associated entities and the
second value represents the maximum number of associated entities
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 10
Connectivity and Cardinality (2 of 2)
Figure 4.7 Connectivity and
Cardinality in an ERD
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 11
Existence Dependence
• An entity is said to be existence-dependent if it can exist in the database only when
it is associated with another related entity occurrence
− An entity is existence-dependent if it has a mandatory foreign key
• If an entity can exist apart from all of its related entities, it is existence-independent
− It is referred to as a strong entity or regular entity
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 12
Relationship Strength (1 of 3)
• Weak (Non-identifying) Relationships
− A weak relationship exists if the primary key of the related entity does not
contain a primary key component of the parent entity
• Strong (Identifying) Relationships
− A strong relationship exists when the primary key of the related entity contains a
primary key component of the parent entity
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 13
Relationship Strength (2 of 3)
Figure 4.9 A Weak (Non-Identifying)
Relationship Between COURSE and
CLASS
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 14
Relationship Strength (3 of 3)
Figure 4.10 A Strong (Identifying)
Relationship Between COURSE and
CLASS
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 15
Weak Entities (1 of 3)
• A weak entity is one that meets the following two conditions:
− The entity is existence-dependent
− The entity has a primary key that is partially or totally derived from parent entity
in the relationship
• The database designer usually determines whether an entity can be described as
weak based on business rules
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 16
Weak Entities (2 of 3)
Figure 4.11 A Weak Entity in an
ERD
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 17
Weak Entities (3 of 3)
Figure 4.12 A Weak Entity in a
Strong Relationship
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 18
Relationship Participation (1 of 3)
• Optional participation means that one entity occurrence does not require a
corresponding entity occurrence in a particular relationship
• Mandatory participation means that one entity occurrence requires a corresponding
entity occurrence in a particular relationship
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 19
Relationship Participation (2 of 3)
• Figure 4.13 An Optional CLASS Entity in the
Relationship “PROFESSOR teaches CLASS”
• Figure 4.14 CLASS is Optional to COURSE
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 20
Relationship Participation (3 of 3)
Figure 4.15 COURSE and CLASS
in a Mandatory Relationship
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 21
Relationship Degree (1 of 3)
• A relationship degree indicates the number of entities or participants associated with
a relationship
• A unary relationship exists when an association is maintained within a single entity
• A binary relationship exists when two entities are associated
• A ternary relationship exists when three entities are associated
• A recursive relationship is a relationship within a single entity type
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 22
Relationship Degree (2 of 3)
Figure 4.16 Three Types of
Relationship Degree
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 23
Relationship Degree (3 of 3)
Figure 4.17 The Implementation of a Ternary Relationship
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 24
Knowledge Check Activity 4-1
What two conditions must be met before an entity can be classified as a
weak entity?
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 25
Knowledge Check Activity 4-1: Answer
What two conditions must be met before an entity can be classified as a
weak entity?
• Answer: To be classified as a weak entity, two conditions must be met:
− The entity must be existence-dependent on its parent entity.
− The entity must inherit at least part of its primary key from its
parent entity.
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 26
Recursive Relationships (1 of 2)
• A recursive relationship can exist between occurrences of the same entity set
− Naturally, such a condition is found within a unary relationship
• One common pitfall when working with unary relationships is to confuse participation
with referential integrity
− Similar because they are both implemented through constraints on the same set
of attributes
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 27
Recursive Relationships (2 of 2)
• Figure 4.18 An ER Representation of Recursive Relationships
• Figure 4.19 The 1:1 Recursive Relationship “EMPLOYEE Is Married to
EMPLOYEE”
• Figure 4.20 Implementation of the 1:M Recursive Relationship
“EMPLOYEE manages EMPLOYEE”
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 28
Associative (Composite) Entities (1 of 2)
• The ER model uses the associative entity to represent an M:N relationship between
two or more entities
• It is also called a composite or bridge entity and is a 1:M relationship with the parent
entities
− It is composed of the primary key attributes of each parent entity
• The composite entity may also contain additional attributes that play no role in
connective process
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 29
Associative (Composite) Entities (2 of 2)
Figure 4.26 A Composite Entity in
an ERD
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 30
Database Design Challenges: Conflicting
Goals (1 of 2)
• Database designers must often make design compromises that are triggered by
conflicting goals
− Database design must conform to design standards
− High processing speed may limit the number and complexity of logically desirable
relationships
− Maximum information generation may lead to loss of clean design structures and
high transaction speed
• A design that meets all logical requirements and design conventions is an important
goal
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 31
Database Design Challenges: Conflicting
Goals (2 of 2)
Figure 4.39 Various
Implementations of the 1:1 Recursive
Relationship
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 32
Knowledge Check Activity 4-2
• How is a relationship between entities indicated in an ERD?
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 33
Knowledge Check Activity 4-2: Answer
• How is a relationship between entities indicated in an ERD?
• Answer: A relationship is indicated by a line connecting the related
entities. STUDENT
Simplified Crow’s Foot entity box
(no attribute component.)
Crow’s Foot entity box
STUDENT
(attribute component included.)
STU_NUM (PK)
STU_LNAME
STU_FNAME
STU_INITIAL
DEPT_CODE (FK)
Crow’s Foot connectivity symbol,
implied (0,N) cardinality.
A weak relationship
A strong relationship
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 34
Summary
Now that the lesson has ended, you should be able to:
1. Identify the main characteristics of entity relationship components
2. Describe how relationships between entities are defined
3. Explain how ERD components affect database design and implementation
4. Describe how real-world database design often requires the reconciliation of
conflicting goals
Coronel, Carlos and Morris, Steven, Database Systems: Design, Implementation, and Management, 14 Edition. © 2023 Cengage.
All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 35