Enhanced ER (EER) Notations
Subclasses and Inheritance
• An entity class B is said to be subclass of
another entity class A, if it shares an is-a
relationship with A.
– Example1: car “is-a” vehicle
– Example2: Monkey “is-a” Primate “is-a” Animal
– Example3: Manager “is-a” Employee
• An entity of class B is said to be specialization of
entities of class A. Conversely, an entities of
class A are generalization of class B entities.
1
Subclasses and Inheritance
• An Entity cannot exist in database that merely
belongs to a subclass. It has to belong to the
super class as well.
• Subclasses undergo type inheritance of the
super class. That is, each member of subclass
has the same attributes as super class entities
and participate in the same relationship types.
Subclasses and Inheritance
PAN
• Depicts the relation
Manager is-a Employee
Employee
• Manager inherits PAN as a
key attribute
• Other attribute in addition
to PAN may form the key
for Manager Entity
Manager
2
Specialization and Generalization
• The processes of creating subclasses out of a
given entity type is called specialization
• The reverse process of taking two or more entity
types and clubbing them under a common super
class is called generalization
Generalization
PAN Salary PAN Salary
Skills Experience
Secretary Manager
• Consider the above already existing (legacy)
Entity type
3
Generalization
PAN Salary
Employee
Skills Experience
Secretary Manager
• Creation of Generalized class
Predicate-defined Subclasses
• Subclass entity types whose
PAN Salary members can be defined based
on the value of an attribute are
called “Predicate-defined
Subclasses
Employee
JobType
Admin Academic
D
Skills Expertise
Secretary Professor
• The attribute “JobType” above, is called the defining predicate
4
Disjoint and Overlapping Subclasses
• The “D” in the circle represents
PAN Salary that the subclasses are disjoint
• An entity of type Employee may
belong to most one of the
Employee subclasses
JobType
Admin Academic
D
Skills Expertise
Secretary Professor
Disjoint and Overlapping Subclasses
Subclasses that are not
PAN Salary disjoint are said to
overlap.
This is represented by “O”
Employee in the inheritance circle
Expertise Project
Chair
Professor
Professor
• Disjoint or overlap may be either partial or total
5
Union Types or Categories
Individual Family Institution
An account holder can either
U be an Individual, or a Family or
an Institution, each of whom
have their own attributes and
keys.
A Union type is also called a
Account Holder
Category
Union Types or Categories
• In the previous example not every
individual, family or institution listed in
database may be an account holder.
– In such cases “Account Holder” is said to be a
“partial” union. Usually a constraint is
specified that determines which entity
participates in the union.
6
Higher-order Relationships
Supplier Supplies Project
Part
• Depicts the semantics that supplier entity supplies part entity that is
required by project entity
• Cannot be reduced to three binary relationships without losing
meaning
Higher-order Relationships
Supplier Supplies Project
Stocks Part Requires
• Closest meaningful binary relationship scheme.
• Note that part is weak entity type and participates fully in
the stocks and requires relationships.
7
Higher-order Relationships
taught_during
Instructor Offers Semester
can_teach Course Offered_in
For any given Instance of Instructor (i), Semester (s) and
Course (c) note that:
Offers(i,s,c) => taught_during(i,s) && can_teach(i,c) &&
Offered_in(c,s)
But the Converse need not be true!
Higher-order Relationships
Cardinality Constraints
1 N Semester
Instructor Offers
N
Course
• Above Constraints says that: A given course-semester
combination should have only one instructor, however,
an instructor may be associated with many course-
semester pairs.
• Course-semester pair forms the key for this relationship.
8
Aggregation (KM concept)
Requires
1 N Semester
Instructor Offers
N
Offering Course
An Example University Database
9
Some Basic Entity Types
Student
Some Basic Entity Types
Name Gender
DOB
Roll-No
Address
Student
10
Some Basic Entity Types
Name Gender
DOB
Emp-No
Address
Faculty
Some Basic Entity Types
Name Gender
DOB
Emp-No
Address
Staff
11
Generalization
Person
Roll-No
O Emp-No
Student Employee
Faculty Staff
Associations
Faculty Works in Department
Heads
12
Associations
N 1
Faculty Works in Department
1
1 1
Registered in
Heads
N
Student
Aggregations
Sponsored
Project
1 N
Project Involves Department
N 1
1 1
Headed by Faculty Belongs to
13
Higher-order Relationships
1 N
Foundation Supports Department
N
Sponsored
Project
Higher-order Relationships
1 N
Faculty Collaborates Faculty
Project
Note the double use of “Faculty” entity type…
14
Higher-order Relationships
N
Collaborates Project
1 N
Faculty
This is equivalent…
Higher-order Relationships
Collaborates
1 N
Faculty 1 N
Works on Project
This is not equivalent…
15
Summary of EER Concept
• Generalization and Specialization
• Inheritance (of attributes, relationships,
constraints)
• Disjoint and overlapping subclasses
• Union Types and Categories
• Higher-order Relationships
• Aggregation
16