Database Management Systems (2130703)

BE | Semester-3   Summer-2018 | 05/23/2018

Q3) (c)

Explain specialization and generalization concepts in ER diagram with suitable example.

Specialization

  • A top-down design process that creates subclasses based on some different characteristics of the entities in the superclass.
  • An entity set may include sub groupings of entities that are distinct in some way from other entities in the set.
  • For example, a subset of entities within an entity set may have attributes that are not shared by all the entities in the entity set.
  • Consider an entity set person, with attributes name, street and city.
  • A person may be further classified as one of the following:
    • customer
    • employee
  • For example, customer entities may be described further by the attribute customer-id, credit-rating and employee entities may be described further by the attributes employee-id and salary.
  • The process of designating sub groupings within an entity set is called specialization. The specialization of person allows us to distinguish among persons according to whether they are employees or customers.
  • Now again, employees may be further classified as one of the following:
    • officer
    • teller
    • secretary
  • Each of these employee types is described by a set of attributes that includes all the attributes of entity set employee plus additional attributes.
  • For example, officer entities may be described further by the attribute office-number, teller entities by the attributes station-number and hours-per-week, and secretary entities by the attribute hours-per-week.
  • In terms of an E-R diagram, specialization is depicted by a triangle component labeled ISA.
  • The label ISA stands for “is a” and represents, for example, that a customer “is a” person.
  • The ISA relationship may also be referred to as a superclass subclass relationship.

Generalization

  • A bottom-up design process that combines number of entity sets that have same features into a higher-level entity set.
  • The design process proceed in a bottom-up manner, in which multiple entity sets are synthesized into a higher level entity set on the basis of common features.
  • The database designer may have to first identify a customer entity set with the attributes name, street, city, and customer-id, and an employee entity set with the attributes name, street, city, employee-id, and salary.
  • But customer entity set and the employee entity set have some attributes common. This commonality can be expressed by generalization, which is a containment relationship that exists between a higher level entity set and one or more lower level entity sets.
  • In our example, person is the higher level entity set and customer and employee are lower level entity sets.
  • Higher level entity set is called superclass and lower level entity set is called subclass. So the person entity set is the superclass of two subclasses customer and employee.
  • Differences in the two approaches may be characterized by their starting point and overall goal.
Specialization & Generalization