Enhanced Entity Relationship Modelling
Enhanced Entity Relationship Modelling
Enhanced Entity Relationship Modelling
Additional concepts:
subclasses/superclasses
specialization/generalization
IS-A relationships
The additional EER concepts are used to model applications more completely
and more accurately
EER includes some object-oriented concepts, such as inheritance
1
Subclasses and Superclasses
2
Subclasses and Superclasses
3
Subclasses and Superclasses
A technician is an employee
A manager is an employee
…
4
Subclasses and Superclasses
EMPLOYEE, ….
An entity cannot exist in the database merely by being a
5
Subclasses and Superclasses
Examples:
A salaried employee who is also an engineer belongs to the two subclasses:
ENGINEER, and
SALARIED_EMPLOYEE
three subclasses:
MANAGER,
ENGINEER, and
SALARIED_EMPLOYEE
6
Subclasses and Superclasses
If the relationship is not Total, then it is not necessary that every entity in a
superclass be a member of some subclass
If the relationship is Total, then every entity in a superclass must be a member
of some subclass
Superclass Superclass
7
Representing Specialization in EER Diagrams
8
Inheritance in Class / Subclass Relationships
Example:
In the previous slide, SECRETARY (as well as TECHNICIAN
and ENGINEER) inherit the attributes Name, SSN, …, from
EMPLOYEE
Every SECRETARY entity will have values for the inherited
attributes
9
Specialization
10
Specialization
diagrams
Attributes of a subclass are called specific or local attributes.
11
Specialization
12
Generalization
VEHICLE.
We can view {CAR, TRUCK} as a specialization of VEHICLE
13
Generalization
14
Classes
15
Membership Constraint
16
Membership Constraint
17
Membership Constraint
18
Disjointness Constraint
Disjointness Constraint:
Specifies that the subclasses of the specialization must be
disjoint:
an entity can be a member of at most one of the subclasses
of the specialization
Specified by d in EER diagram
19
Completeness Constraint
Completeness Constraint:
Total (mandatory) specifies that every entity in the superclass
subclasses
Shown in EER diagrams by a single line
20
Example of disjoint partial Specialization
21
Example of overlapping total Specialization
22
Specialization/Generalization Hierarchies, Lattices, Shared Subclasses
23
Shared Subclass “Engineering_Manager”
24
Specialization/Generalization Hierarchies, Lattices & Shared
Subclasses
25
Lattice Example (UNIVERSITY)
26
Categories (Union Types)
27
Categories
28
Two categories: OWNER, REGISTERED_VEHICLE
29