Page 182 - DCAP402_DCAO204_DATABASE MANAGEMENT SYSTEM_MANAGING DATABASE
P. 182
Unit 10: Datalog and Recursion
10.6 Generalization Notes
A generalization hierarchy is a structured grouping of entities that share common attributes. It
is a powerful and widely used method for representing common characteristics among entities
while preserving their differences. It is the relationship between an entity and one or more
refined versions. The entity being refined is called the supertype and each refined version is
called the subtype.
Generalization hierarchies should be used when (1) a large number of entities appear to be of
the same type, (2) attributes are repeated for multiple entities, or (3) the model is continually
evolving. Generalization hierarchies improve the stability of the model by allowing changes to
be made only to those entities germane to the change and simplify the model by reducing the
number of entities in the model.
Creating a Generalization Hierarchy
To construct a generalization hierarchy, all common attributes are assigned to the supertype.
The supertype is also assigned an attribute, called a discriminator, whose values identify the
categories of the subtypes. Attributes unique to a category, are assigned to the appropriate
subtype. Each subtype also inherits the primary key of the supertype. Subtypes that have only a
primary key should be eliminated. Subtypes are related to the supertypes through a one-to-one
relationship.
Types of Hierarchies
A generalization hierarchy can either be overlapping or disjoint. In an overlapping hierarchy an
entity instance can be part of multiple subtypes. For example, to represent people at a university
you have identified the supertype entity PERSON which has three subtypes, FACULTY, STAFF,
and STUDENT. It is quite possible for an individual to be in more than one subtype, a staff
member who is also registered as a student.
Example: In a disjoint hierarchy, an entity instance can be in only one subtype. For
example, the entity EMPLOYEE, may have two subtypes, CLASSIFIED and WAGES. An employee
may be one type or the other but not both. Figure 10.6 shows A) overlapping and B) disjoint
generalization hierarchy.
Figure 10.6
Contd...
LOVELY PROFESSIONAL UNIVERSITY 175