Lecture 4
Lecture 4
Relationship Model
Objectives
• Definition of terms
• Use of supertype/subtype relationships
• Aggregation
• Use of generalization and specialization techniques
• Specification of completeness and disjoint constraints
• Develop supertype/subtype hierarchies for realistic business situations
• Union Type or Category
• ER Model Project
• Develop entity clusters
• Explain universal data model
• Name categories of business rules
• Define operational constraints graphically and in English
Enhanced Entity Relationship Diagram
• Enhanced ERD 🡪 The model that has resulted from extending the original ER model with
new modeling constructs.
• Entity type 🡪 a collection of entities that have the same attributes (properties or
characteristics)
• In some situations, an entity type can be divided into several subgroups or subtypes
• Supertype 🡪 entity type that can be divided into subtypes
• A supertype is a generic entity type that has a relationship with one or more subtypes
• Subtype 🡪 a subset of a supertype and shares common attributes
• Behave like other entity types
• The identifiers (primary keys) of supertype and subtypes are always identical
a) EER
Notatio
n
Basic Notation for Supertype/Subtype Notation
(Cont.)
b)
Microsoft
Visio
Notation
Both
outpatients
and resident
patients are
cared for by
a responsible
physician
Bottom Up
Example of Generalization
a) Three entity types: CAR, TRUCK, and MOTORCYCLE
So we put
the shared
attributes in
a supertype
Top Down
Example of Specialization
a) Entity type PART
Only applies to
manufactured parts
Created 2
subtypes
A vehicle
could be a
car, a
truck, or
neither
Inclusion of Constraints on Generalization and
Specialization
• Subclasses are disjoint 🡪 if an entity can be a member of only one subclass
• Subclasses are non-disjoint 🡪 if an entity can be a member of more than one
subclasses (i.e. subclasses are overlapping)
b) Overlap rule
Step 4
•Each department has a chairman, while a chairman chairs only one
department.
Project 1
Step 5
•In a university, a teacher belongs to one and only one department. However,
a department may have at least one or many teachers. The teacher can be
visiting, part-time, or full-time.
Project 1
COMPLETE EE-R MODEL OF UNIVERSITY SYSTEM
Entity Clusters
• EER diagrams are difficult to read when there are too many entities
and relationships
• Solution: Group entities and relationships into entity clusters
• Entity cluster: Set of one or more entity types and associated
relationships grouped into a single abstract entity type
Possible Entity
Clusters for Pine
Valley Furniture in
Microsoft Visio
Related groups
of entities could
become clusters
EER Diagram of PVF Entity Clusters
More readable,
isn’t it?
Manufacturing Entity Cluster
• Result
• Condition–IF/THEN rule
• Integrity constraint–must always be true
• Authorization–privilege statement
• Form
• Enabler–leads to creation of new object
• Timer–allows or disallows an action
• Executive–executes one or more actions
• Rigor
• Controlling–something must or must not happen
• Influencing–guideline for which a notification must occur
Stating an Action Assertion
Corresponding object
Anchor object
Corresponding object
Business Rule 2: For a faculty member to be assigned to teach a section of
a course, the faculty member must not be assigned to teach a total of more
than three course sections
Upper LIMit
Action assertion
Anchor object