Professional Documents
Culture Documents
Prepared by ELias B.
Outline
Subclass, Super-class and Inheritance
Chap 4
Constraints and Characteristics of Specialization and
Generalization
1
SUBCLASSES, SUPER CLASSES, AND INHERITANCE
In many cases an entity type has numerous sub groupings or
subtypes of its entities that are meaningful and need to be
represented explicitly because of their significance to the database
application.
Prepared by ELias B.
For example, the entities that are members of the EMPLOYEE
entity type may be distinguished further into SECRETARY,
ENGINEER,MANAGER,TECHNICIAN,SALARIED_EMPLOY
EE,HOURLY_EMPLOYEE, and so on.
Chap 4
The set of entities in each of the latter groupings is a subset of the
entities that belong to the EMPLOYEE entity set, meaning that
every entity that is a member of one of these sub groupings is also
an employee.
We call each of these sub groupings a subclass or subtype of the
EMPLOYEE entity type, and the EMPLOYEE entity type is2
called the super class or super type for each of these subclasses.
Prepared by ELias B. Chap 4
3
EXAMPLE
Relationships and attributes of super class
are inherited to subclass (in particular
primary key attribute(s)); subclass can
Prepared by ELias B.
have additional attributes and
relationships
An entity cannot exist merely by being a
Chap 4
member of only a subclass.
4
SPECIALIZATION AND GENERALIZATION
1. Specialization is the process of defining a set of subclasses of
an entity type. (top-down)
This entity type is called the super class of the specialization.
Prepared by ELias B.
The set of subclasses that forms a specialization is defined on
the basis of some distinguishing characteristic of the entities in
the super class.
2. Generalization
Chap 4
Reverse process of specialization (bottom-up);
5
DIAGRAMMATIC NOTATION FOR SPECIALIZATION
Prepared by ELias B.
Chap 4
6
CONT…
HOURLY EMPS is a subclass of EMPLOYEES and thus
inherits its attributes and relationships (same for
CONTRACT EMPS).
Prepared by ELias B.
Chap 4
7
DIAGRAMMATIC NOTATION FOR GENERALIZATION
Prepared by ELias B.
Chap 4
8
DESIGN CONSTRAINTS ON A
SPECIALIZATION/GENERALIZATION
Prepared by ELias B.
senior-citizen entity set; senior-citizen ISA person.
user-defined
Chap 4
Disjoint
an entity can belong to only one lower-level entity set
set
CONT…
Completeness constraint -- specifies whether or not an entity in
the higher-level entity set must belong to at least one of the
lower-level entity sets within a generalization.
Prepared by ELias B.
total: an entity must belong to one of the lower-level entity
sets
partial: an entity need not belong to one of the lower-level
entity sets
Chap 4
Restricts the design of the Data Base Management System
Restricts the design of the Data Base Management System
Restricts the design of the Data Base Management System
10
EER MODEL
EER is a high-level data model that incorporates the extensions to the
original ER model.
Prepared by ELias B.
Union or Category
Aggregation
These concepts are used when the comes in EER schema and the resulting
schema diagrams called as EER Diagrams.
Chap 4
Features of EER Model
Prepared by ELias B.
Super class is an entity type that has a relationship with one or
more subtypes.
An entity cannot exist in database merely by being member of
Chap 4
any super class. For example: Shape super class is having sub
groups as Square, Circle, Triangle.
2. Sub Class
Sub class is a group of entities with unique attributes.
1. Generalization
Generalization is the process of generalizing the
entities which contain the properties of all the
generalized entities.
Prepared by ELias B.
It is a bottom approach, in which two lower level
entities combine to form a higher level entity.
Generalization is the reverse process of
Chap 4
Specialization.
It defines a general entity type from a set of
specialized entity type.
It minimizes the difference between the entities by
14
identifying the common features.
For example:
Prepared by ELias B.
Chap 4
IN THE ABOVE EXAMPLE, TIGER, LION, ELEPHANT CAN ALL BE GENERALIZED AS ANIMALS . 15
2. SPECIALIZATION
Specialization is a process that defines a group entities
which is divided into sub groups based on their
characteristic.
It is a top down approach, in which one higher entity
Prepared by ELias B.
can be broken down into two lower level entity.
It maximizes the difference between the members of
an entity by identifying the unique characteristic or
attributes of each member.
Chap 4
It defines one or more sub class for the super class and
also forms the superclass/subclass relationship.
For example
16
Prepared by ELias B.
Chap 4
IN THE ABOVE EXAMPLE, EMPLOYEE CAN BE SPECIALIZED AS DEVELOPER OR
TESTER, BASED ON WHAT ROLE THEY PLAY IN AN ORGANIZATION. 17
C. CATEGORY OR UNION
Category represents a single super class or sub class
relationship with more than one super class.
It can be a total or partial participation.
For example Car booking, Car owner can be a person, a bank
(holds a possession on a Car) or a company. Category (sub
Prepared by ELias B.
class) → Owner is a subset of the union of the three super
classes → Company, Bank, and Person.
A Category member must exist in at least one of its super
classes.
Chap 4
18
Prepared by ELias B. Chap 4
19
D. AGGREGATION
Aggregation is a process that represent a
relationship between a whole object and its
component parts.
Prepared by ELias B.
It abstracts a relationship between objects and
viewing the relationship as an object.
It is a process when two entity is treated as a
Chap 4
single entity.
20
Prepared by ELias B.
Chap 4
IN THE ABOVE EXAMPLE, THE RELATION BETWEEN COLLEGE AND
COURSE IS ACTING AS AN ENTITY IN RELATION WITH STUDENT. 21
Prepared by ELias B. Chap 4
22
END