Professional Documents
Culture Documents
Lecture 3 - ERD and Enhanced ERD Modeling
Lecture 3 - ERD and Enhanced ERD Modeling
Lecture 3 - ERD and Enhanced ERD Modeling
2
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
The Entity Relationship Model (ERM)
3
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Attributes
• Characteristics of entities
• Required attribute: must have a value and cannot be left empty
• Optional attribute: does not require a value and can be left empty
• Domain: set of possible values for a given attribute
4
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Attributes (Cont.)
• Characteristics of entities
• Identifier: one or more
attributes that uniquely
identify each entity instance
• Single-valued attribute:
attribute that has only a
single value
• Multivalued attributes:
attributes that have many
values
• Derived attribute: attribute
whose value is calculated
from other attributes
5
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Relationship Strength
• Strong (identifying)
relationships
• Primary key of the related
entity contains a primary key
component of the parent
entity
• Conditions of a weak entity
• Existence-dependent
• Has a primary key that is
partially or totally derived from
parent entity in the
relationship
6
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Relationship Strength (Cont.)
7
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Relationship Strength (Cont.)
• Weak (non-identifying)
relationship
• Primary key of the
related entity does not
contain a primary key
component of the
parent entity
8
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Relationship Participation
• Optional participation
• One entity occurrence does not require a corresponding entity occurrence in a
particular relationship
• Mandatory participation
• One entity occurrence requires a corresponding entity occurrence in a
particular relationship
9
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Relationship Degree
10
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Recursive Relationships
• Relationship can
exist between
occurrences of the
same entity set
• Naturally, such a
condition is found
within a unary
relationship
• Common in
manufacturing
industries
11
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Developing an ER Diagram
• Tiny College (TC) is divided into
several schools: business, arts and
sciences, education, and applied
sciences.
• Each school is administered by a
dean who is a professor. Each
professor can be the dean of only
one school, and a professor is not
required to be the dean of any
school.
• Each school comprises of at least
one department e.g., the school of
business has an accounting
department, a management
department, an economics
department. Each department
belongs to only a single school.
12
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Developing an ER Diagram (Cont.)
• Each department may offer courses. For example, the management department
offers courses such as Introduction to Management and Production Management.
• Some departments that were classified as “research only,” they would not offer
courses.
13
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Developing an ER Diagram (Cont.)
14
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Developing an ER Diagram (Cont.)
15
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Developing an ER Diagram (Cont.)
16
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Developing an ER Diagram (Cont.)
• A student may enroll in several classes but take each class only once during any
given enrollment period.
• Each student may enroll in up to six classes.
• Each class may have up to 35 students.
17
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Developing an ER Diagram (Cont.)
• Each department has several (or many) students whose major is offered by that
department.
• Each student has only a single major and is therefore associated with a single
department.
• In the Tiny College environment, it is possible—at least for a while—for a student
not to declare a major field of study. Such a student would not be associated with a
department yet.
18
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Developing an ER Diagram (Cont.)
19
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Developing an ER Diagram (Cont.)
20
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Developing an ER Diagram (Cont.)
21
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
The Extended Entity Relationship Model (EERM)
22
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Specialization Hierarchy
• Specialization hierarchy:
• Depicts arrangement of higher-
level entity supertypes and
lower-level entity subtypes
• Relationships are described in
terms of “is-a” relationships
• Every subtype has one
supertype to which it is directly
related
• Supertype can have many
subtypes
23
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Inheritance
24
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Subtype Discriminator
• Attribute in the
supertype entity that
determines to which
entity subtype the
supertype occurrence is
related
• Default comparison
condition is the equality
comparison
25
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Disjoint and Overlapping Constraints
• Disjoint subtypes:
contain a unique subset
of the supertype entity set
• Known as nonoverlapping
subtypes
• Overlapping subtypes:
contain nonunique
subsets of the supertype
entity set
• Implementation requires
the use of one
discriminator attribute for
each subtype
26
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Disjoint and Overlapping Constraints (Cont.)
27
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Completeness Constraint
28
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Specialization and Generalization
Specialization Generalization
Top-down process Bottom-up process
Identifies lower-level, more specific entity subtypes Identifies a higher-level, more generic entity
from a higher-level entity supertype supertype from lower-level entity subtypes
Based on grouping unique characteristics and Based on grouping common characteristics and
relationships of the subtypes relationships of the subtypes
29
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.
Summary
30
© 2019 Cengage. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license distributed with a certain product or service or otherwise on a password-p
rotected website for classroom use.