EER Modelling
EER Modelling
RELATIONSHIP (EER)
MODELING
INTRODUCTION
Enhanced Entity Relationship (EER) model is
an extension of the original ER model
All employee
subtypes will have
emp_no., name,
address, and date-
hired
Each employee
subtype will also
have its own
attributes
SUPERTYPE/SUBTYPE RELATIONSHIPS
Allows us to model a general entity type (the
supertype) and then subdivide it into several
specialised entity types (called subtypes)
SALARIED_EMPLOYEE, HOURLY_EMPLOYEE
7
SUBCLASSES AND SUPERCLASSES
8
Subclasses and Superclasses
9
ATTRIBUTE INHERITANCE IN
SUPERCLASS / SUBCLASS RELATIONSHIPS
An entity that is member of a subclass inherits
All attributes of the superclass
All relationships of the superclass
Example:
The SECRETARY (as well as TECHNICIAN and ENGINEER)
inherit the attributes Name, SSN, …, from EMPLOYEE
Every SECRETARY entity will have values for the
inherited attributes
SALARIED_EMPLOYEE
12
WHEN TO USE SUPERTYPE/SUBTYPE
RELATIONS
We use subtypes when
There are attributes that apply to some (but
not all) of the instances of an entity type
The instances of a subtype participate in a
relationship unique to that subtype
Supertype/subtype relationships of patients
Both outpatients
and resident
patients are cared
for by a responsible
physician
Specialization
The process of defining one or more subtypes of
the supertype, and forming supertype/subtype
relationships.
TOP-DOWN
Example of Generalization
Three entity types: CAR, TRUCK, and MOTORCYCLE
So we put
the shared
attributes in
a supertype
Only applies
to
manufactured
parts
Specialization to MANUFACTURED PART and PURCHASED PART
Created 2 subtypes
(0,N)
(1,N)
Partial
Specialization : An entity instance of the
supertype is allowed not to belong to any
subtype.
Examples of completeness constraints
Total specialization rule
(0,N)
(1,1)
A patient must be
either an
outpatient or a
resident patient
(1,1) (0,1)
Partial specialization rule
A vehicle could be
a car, a truck, or
neither
(motorcycle)
DISJOINTNESS CONSTRAINT
Can an instance of a supertype may
simultaneously be a member of two (or
more) subtypes?
Yes
We have two possibilities: Disjoint or
Overlapping Subtypes
DISJOINTNESS CONSTRAINT
Disjoint Rule: An instance of the supertype
can be only ONE of the subtypes.
It is specified by the letter ‘d’
(1,1)
(0,N)
(1,1) (0,1)
DISJOINTNESS CONSTRAINT
• Overlap Rule: An instance of the supertype
can simultaneously be a member of more than
one of the subtypes.
A part may be
both
purchased and
manufactured (0,N)
(1,N)
class diagrams
32
ALTERNATIVE DIAGRAMMATIC NOTATIONS
33
SUMMARY
Introduced the EER model concepts
Class/subclass relationships
Specialization and generalization
Inheritance
These augment the basic ER model concepts
introduced in Chapter 3
EER diagrams and alternative notations were
presented
34