CH - 3.2 EER
CH - 3.2 EER
PART TWO
Enhanced Entity Relation Model
(EER)
Objectives of Chapter
Superclass, Subclass and Inheritance
2
Introduction
The databases as CAD/CAM, telecommunications, complex software systems, GIS (global information
system), etc.. have more complex requirements.
This lead to the development of additional semantic data modeling concepts that were incorporated
into conceptual data models such as the ER model.
The ER model can be enhanced to include the features that have been proposed for semantic data
models, leading to the enhanced ER (EER) model. The EER model includes all the modeling concepts
of the ER model.
In addition, it includes the concepts of superclass & subclass and the related concepts of specialization
& generalization and also includes some object-oriented concepts, such as inheritance.
The diagrammatic technique for displaying these concepts in EER schema is called Enhanced ER ,EER
Diagrams or Extended ER Diagrams.
Superclasses, Subclasses & Inheritance
Cont’d
In ER modeling, an entity type is used to represent both a type of entity and the entity set (collection of entities
of that type) that exists in the database.
In many cases, An entity type may have additional meaningful subgroupings of its entities.
These sub groupings are called as a subclass of the EMPLOYEE entity type and the EMPLOYEE entity type is
called the superclass for each of these subclasses.
Superclass also called parent or base class, it is a class from which many subclass can be created.
The figure below shows how these concepts are diagrammatically represented in EER
diagrams.
Cont’d
The relationship between a superclass and any one of its subclasses is called as a
class/subclass relationships or IS-A relationships.
A member entity of the subclass represents the same real world entity as some member of
the superclass.
For eg: a SECRETARY entity, say ‘Mary Smith’ is also the EMPLOYEE ‘Mary Smith’.
Hence the subclass member is the same as the entity in the super class, but in a distinct
specific role.
Cont’d
An entity cannot exist in the database merely by being a member of a subclass; it must
For eg: a salaried employee who is an engineer belongs to the two subclasses
A salaried employee who is also an engineering manager belongs to the three subclasses:
some subclasses.
Attribute Inheritance in Superclass / Subclass Relationships
Since, an entity in the subclass represents the same real-world entity from the superclass, it
should possess values for its specific attributes.
An entity that is a member of a subclass inherits all the attributes of the entity as the
member of the superclass.
Example: In the previous slide, SECRETARY (as well as TECHNICIAN and ENGINEER)
inherit the attributes Name, SSN, …, from EMPLOYEE
Specialization & Generalization
Specialization
Specialization is the process of defining a set of subclasses of an entity type or superclass.
The set of subclasses that forms a specialization is defined on the basis of some distinguishing
characteristics.
of the superclass EMPLOYEE that distinguishes among employee entities based on the job_type
of each employee entity.
There can have several specializations of the same entity type, based on different distinguishing
characteristics.
Example2: MANAGER is a specialization of EMPLOYEE based on the role the employee plays.
Cont’d
Example3: the subclasses {SALARIED_EMPLOYEE, HOURLY_EMPLOYEE} is a
specialization of the superclass EMPLOYEE entity type based on the method of pay.
in EER diagrams.
Establish additional specific relationship types between each subclass and other entity
types or other subclasses.
Generalization
Several classes with common features are generalized into a superclass. Or extract common properties
from set of entities and create a generalized entity from it.
Both CAR and TRUCK entities are now subclasses of the generalized superclass VEHICLE.
Cont’d
Notice that generalization process can be viewed as being functionally the inverse of the
specialization process.
In general, there may have several specialization defined on the same entity type (or super
class) as shown in the diagram 4.1.
We can specify the membership in the SECRETARY subclass, by the condition (Job_type= ‘Secretary’),
which we call the defining predicate of the subclass.
A predicate_defined subclass is displayed by writing the predicate condition next to the line that
connects the subclass to the specialization circle.
If all subclasses in a specialization have their membership condition on the same attribute of the
superclass, the specialization itself is called an attribute_defined specialization.
When there is no condition for determining membership in a subclass, the subclass is called
user_defined subclass.
Cont’d
Cont’d
However, a specialization may also consist of a single subclass only, such as the
{MANAGER} specialization in the figure on next slide.
In such situations, the circle notation will not be used (refer the diagram on next slide).
In some specialization, it is possible to determine exactly the entities that will become
members of each subclass by placing a condition on the value of some attribute of the
superclass.
This means that an entity can be a member of atmost one of the subclasses of the
specialization.
The same notation is also used to specify the constraint that user_defined subclasses of a
specialization, which must be disjoint.
Cont’d
If the subclasses are not constrained to be disjoint, their sets of entities may overlap; i.e, the same entity
may be a member of more than one subclass of the specialization.
This case is displayed by placing a o in the circle as shown in the below diagram.
Completeness Constraint
The other constraint on specialization is called the completeness constraint, which may be total or partial.
A total specialization constraint specifies that every entity in the superclass must be a member of at least one
For eg: if every EMPLOYEE must be either an HOURLY_EMPLOYEE or a SALARIED_EMPLOYEE, then the
specialization of EMPLOYEE.
This is shown in EER diagrams by double line to connect the super class to the circle.
A single line is used to display a partial specialization, which shows an entity may not belong to any of the
subclasses.
For eg: if some EMPLOYEE entities do not belong to any of the subclasses {SECRETARY, ENGINEER,
Disjoint, total
Disjoint, partial
Overlapping, total
Overlapping, partial
Example of Disjoint Partial Specialization
Example of Overlapping Total Specialization
Rules in specialization and generalization
Certain insertion and deletion rules apply to specialization (and generalization) as a
consequence of the constraints specified earlier.
Deleting an entity from a super class implies that it is automatically deleted from all the
subclasses to which it belongs.
Inserting an entity in a super class implies that the entity is mandatorily inserted in all
predicate_defined (or attribute_defined) subclasses for which the entity satisfies the
defining predicate.
Inserting an entity in a super class of a total specialization implies that the entity is
mandatorily inserted in atleast one of the subclasses of the specialization.
33