Chapter 41 Enhanced Entity-Relationship and Object Modeling.
LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP...
Transcript of LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP...
LELCTURE 4:
ENHANCED ENTITY-RELATIONSHIP
MODELING (EER) Ref. “Chapter12”
from
“Database Systems: A Practical Approach to Design, Implementation and Management.”
Thomas Connolly, Carolyn Begg.
I S 2 2 0 : D at ab as e F u n d am e n t al s
Chapter Objectives
In this chapter you will learn:
The limitations of the basic concepts of the Entity–Relationship
(ER) model and the requirements to represent more complex
applications using additional data modeling concepts.
The most useful additional data modeling concepts of the
Enhanced Entity–Relationship (EER) model called
specialization/generalization and inheritance.
2
Main Terms 3
• Enhanced ER model.
• Specialization
• Generalization
• Inheritance.
• Participation constraints.
• Disjoint constraints.
Enhanced Entity-Relationship (EER)
Model •4
Enhanced Entity-Relationship (EER) Model is an ER model
supported with additional semantic concepts.
Semantic concepts supported:
Specialization
Generalization
Specialization
5
Specialization: Top-down design process; we designate
sub-groupings within an entity type that are distinctive
from other entities in the set.
Generalization
6
Generalization: A bottom-up design process – combine a
number of entity types that share the same features into a
higher-level (superclass) entity type.
Specialization and generalization are simple inversions of
each other; they are represented in an EER diagram in the
same way.
Specialization/ Generalization
7
The sub-groupings (subclasses) become lower-level entity
types that have attributes or participate in relationships
that do not apply to the higher-level entity set
(superclass).
Superclass/Subclass Relationship
8
STAFF
MANAGER SECRETARY SALES
PERSONNEL Subclass
Superclass
IS_A relationship
1:1
Inheritance
9
A subclass entity type inherits all the attributes and
relationship participation of the superclass entity type to
which it is linked.
An entity in a subclass represents the same ‘real world’ object
as in the superclass, and may possess subclass-specific
attributes, and sometimes relationships, as well as those
associated with the superclass.
Inheritance (cont.)
10
STAFF
SALES
PERSONNEL
Unshared
attributes
Superclass
address dob name
sales area
car allowance
shared
attributes
Subclass require CAR
Unshared
relationship
contract COMPANY
Shared
relationship
Constraints on
Specialization/Generalization 11
There are two constraints that may apply to a specialization/
generalization:
Participation constraint
Disjoint constraints.
Participation Constraints 12
Participation constraint determines whether every member in the
superclass must participate as a member of a subclass.
Two types of participation constraints:
Mandatory (total)
Optional (partial)
Participation Constraints (cont.)
13
Mandatory (total) participation where every member in the
superclass must also be a member of a subclass.
STAFF
FULL-TIME
STAFF
PART-TIME
STAFF salary Hourly-rate
Participation Constraints (cont.)
14
Optional (partial) participation where a member in the
superclass need not belong to any of its subclasses.
STAFF
MANAGER SECRETARY SALES
PERSONNEL
Disjoint Constraints 15
Disjoint constraint describes the relationship between members
of the subclasses & indicates whether it is possible for a member
of a subclass to be a member of one, or more than one,
subclasses.
Two types of disjoint constraints:
Disjoint
Non-Disjoint
Disjoint Constraints (cont.)
16
Disjoint constraint (d): when an entity can be a member of only
one of the subclasses of the specialization.
STAFF
FULL-TIME
STAFF
PART-TIME
STAFF salary Hourly-rate
d
Disjoint Constraints (cont.)
17
Non-disjoint constraints (o): an entity is a member of more than
one subclass of specialization. Entity types may overlap.
STAFF
MANAGER SECRETARY SALES
PERSONNEL
o
Summary of ER notations
18
ENTITY
WEAK ENTITY
RELATIONSHIP
IDENTIFYING
RELATIONSHIP
ATTRIBUTE
KEY ATTRIBUTE
MULTI-VALUED
COMPOSITE
DERIVED
Summary of ER notations (cont.)
19
CARDINALITY
CONSTRAINTS
PARTICIPATION
CONSTRAINTS
1 M
(min,max)
Summary of EER notations
20
Disjoint constraint d
o Non-Disjoint constraint
Total Participation
Optional Participation