DBMS Unit 1 (Lecture 11)
DBMS Unit 1 (Lecture 11)
Unit-1(Lecture-11)
Enhanced Entity-Relationship (EER) Modeling
• The EER (Enhanced ER) model includes all the modeling concepts of the ER model. In
addition, it includes the concepts of sub-classes and super-classes and the related
concepts of specialization and generalization.
• Another concept included in the EER model is that of a category or union type.
Subclasses, Super classes, and Inheritance
• In many cases an entity type has numerous sub groupings of its entities.
• For example, the entities that are members of the EMPLOYEE entity type may be
grouped further into SECRETARY, ENGINEER, MANAGER, TECHNICIAN,
SALARIED_EMPLOYEE, HOURLY_EMPLOYEE, and so on.
• We call each of these sub groupings a subclass of the EMPLOYEE entity type, and the
EMPLOYEE entity type is called the super class for each of these subclasses.
• We call the relationship between a super class and any one of its subclasses a super
class/subclass or simply class/subclass relationship.
• An entity cannot exist in the database merely by being a member of a subclass; it must
also be a member of the super class.
• For example, a salaried employee who is also an engineer belongs to the two
subclasses ENGINEER and SALARIED_EMPLOYEE of the EMPLOYEE entity type.
• The entity also inherits all the relationships in which the super class participates.
Specialization
• Specialization is the process of defining a set of subclasses of an entity type; this entity
type is called the super class of the specialization.
• Another specialization of the EMPLOYEE entity type may yield the set of subclasses
{SALARIED_EMPLOYEE, HOURLY_EMPLOYEE}.
Instances of a Specialization
Generalization
• We can think of a reverse process of abstraction in which we suppress the differences
among several entity types, identify their common features, and generalize them into a
single super class.
• For example, consider the entity types CAR and TRUCK shown:
• Because they have several common attributes, they can be generalized into the entity
type VEHICLE.
• Both CAR and TRUCK are now subclasses of the generalized super class VEHICLE.
• The generalization process can be viewed as being functionally the inverse of the
specialization process. Hence, we can view {CAR, TRUCK} as a specialization of VEHICLE,
rather than viewing VEHICLE as a generalization of CAR and TRUCK.
Constraints on Specialization and Generalization
• We can place a condition on the value of some attribute of the super class.
Disjointness Constraint
Completeness Constraint
Disjointness Constraint
• Disjointness constraint specifies that the subclasses of the specialization must be
disjoint. This means that an entity can be a member of at most one of the subclasses of
the specialization.
• If the subclasses are not constrained to be disjoint, their sets of entities may overlap;
that is, the same (real-world) entity may be a member of more than one subclass of
the specialization. This case, which is the default, is displayed by placing an o in the
circle
Completeness Constraint
• Completeness constraint may be total or partial.
• Total specialization: A total specialization constraint specifies that every entity in the
super class must be a member of some subclass in the specialization.
• For example, if some EMPLOYEE entities do not belong to any of the subclasses
{SECRETARY, ENGINEER, TECHNICIAN} , then that specialization is partial.
• Disjoint, total
• Disjoint, partial
• Overlapping, total
• Overlapping, partial
Aggregation
• Aggregation is the process of compiling information on an object, there by abstracting a
higher level object.
• One limitation of the E-R model is that it cannot express relationships among
relationships.
• Consider the ternary relationship works-on, between an employee, branch, and job.
Now, suppose we want to record managers for tasks performed by an employee at a
branch. There another entity set manager is created.
• The best way to model such a situation is to use aggregation.
• Aggregation is an abstraction through which relationships are treated as higher level
entities.
• In our example works-on act as high level entity.
E-R diagram with redundant relationships
E-R diagram with Aggregation