The Enhanced E-R Model: Modern Database Management
The Enhanced E-R Model: Modern Database Management
1
OBJECTIVES
Define terms
Understand the use of supertype/subtype relationships
Understand the use of specialization and generalization
techniques
Specify completeness and disjointness constraints
Develop supertype/subtype hierarchies for realistic
business situations
Develop entity clusters
Explain universal (packaged) data model
Describe special features of data modeling project using
packaged data model
a) EER
notation
(通用化的)
(特化的)
b) Microsoft Visio
Notation
Different modeling tools may have different notation for the same
modeling constructs.
1. What are the common attributes for all these types of vehicles ?
2. What is the supertype/subtype relationship ?
So we put
the shared
attributes in
a supertype
Note
No subtype for motorcycle, since it has no unique attributes
The only attributes of MOTOTCYCLE are those common to all vehicles
Chapter 3 © 2013 Pearson Education
13
Figure 3-5 Example of specialization process
a) Entity type PART
Only applies to
manufactured parts
Created 2
subtypes
a) Disjoint rule
PATIENT
RESIDENCE
OUTPATIENT
PATIENT
PART
M PART P PART
PART
When does this situation happen ?
M PART P PART
Chapter 3 © 2013 Pearson Education
21
CONSTRAINTS IN
SUPERTYPE/SUBTYPE RELATIONSHIPS
Subtype Discriminator:
An attribute of the supertype whose values determine
the target subtype(s)
For disjoint subtypes
a simple attribute with different values to indicate the
possible subtypes
For overlapping subtypes
a composite attribute whose subparts pertain to different
subtypes. Each subpart contains a Boolean value to
indicate whether or not the instance belongs to the
associated subtype
Chapter 3 © 2013 Pearson Education
22
Figure 3-8 Introducing a subtype discriminator (disjoint rule)
1. Three cases:
• Y, Y
• Y, N
• N, Y
2. Why 3 cases?
Case 2 Case 3
Related groups
of entities could
become entity
clusters
More readable,
isn’t it?