0% found this document useful (0 votes)
23 views18 pages

DBMS Unit 1 (Lecture 11)

The document discusses key concepts in enhanced entity-relationship (EER) modeling including subclasses and superclasses, specialization and generalization. It describes how subclasses inherit attributes and relationships from superclasses. Specialization is defined as creating subclasses from a super class, while generalization involves identifying common features among entity types and grouping them under a super class. Constraints like disjointness and completeness are described for specializations. Aggregation is introduced as a way to model relationships among relationships by treating them as higher level entities.

Uploaded by

Aditi Matta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views18 pages

DBMS Unit 1 (Lecture 11)

The document discusses key concepts in enhanced entity-relationship (EER) modeling including subclasses and superclasses, specialization and generalization. It describes how subclasses inherit attributes and relationships from superclasses. Specialization is defined as creating subclasses from a super class, while generalization involves identifying common features among entity types and grouping them under a super class. Constraints like disjointness and completeness are described for specializations. Aggregation is introduced as a way to model relationships among relationships by treating them as higher level entities.

Uploaded by

Aditi Matta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

DBMS

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.

• An entity can be included optionally as a member of any number of subclasses.

• For example, a salaried employee who is also an engineer belongs to the two
subclasses ENGINEER and SALARIED_EMPLOYEE of the EMPLOYEE entity type.

• However, it is not necessary that every entity in a superclass be a member of some


subclass.

• An important concept associated with subclasses is that of type inheritance.


• An entity that is a member of a subclass inherits all the attributes of the entity as a
member of the super class.

• 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.

• For example, the set of subclasses {SECRETARY, ENGINEER, TECHNICIAN} is a


specialization of the super class EMPLOYEE.

• 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.

• Two types of constraints that we may apply to a specialization are:-

 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.

• It is denoted by d in the circle which stands for disjoint.

• 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.

• A double line is used to display a total specialization.

• For example, if every EMPLOYEE must be either an HOURLY_EMPLOYEE or a


SALARIED_EMPLOYEE, then the specialization {HOURLY_EMPLOYEE,
SALARIED_EMPLOYEE} is a total specialization of EMPLOYEE.
• Partial specialization: A single line is used to display a partial specialization, which
allows an entity not to belong to any of the subclasses.

• For example, if some EMPLOYEE entities do not belong to any of the subclasses
{SECRETARY, ENGINEER, TECHNICIAN} , then that specialization is partial.

• Hence, we have the following four possible constraints on specialization:

• 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

You might also like