Difference Between Generalization and Specialization in Tabular Form
The key difference between Generalization and Specialization in DBMS is that a Generalization is a Bottom-up approach. while Specialization is a Top-down approach. Generalization is a bottom-up design process that combines a number of entity sets that have the same features into a higher-level entity. Specialization top-down design process that creates subclasses base on some different characteristics of the entities in the superclass.
|It will work in the Bottom-up approach||It will work in the Top-down approach|
|The process of creating groupings from|
various entity sets are called generalization.
|The process of creating sub-groupings within an entity set is called specialization.|
|Generalization is a process of taking the union of two or more lower-level entity sets to produce a higher-level entity set.||Specialization is a process of taking a subset of a higher level entity set to form a lower-level entity set.|
|Generalization starts with the number of|
entity sets and creates high-level entity set using some common features.
|Specialization starts from a single entity set; it|
creates a different low-level entity set using some different features.
|Generalization reduces the size of a schema.||Specialization increases the size of a schema.|
|Generalization is applied to a group of entities.||Specialization is applied to a single entity.|
- A bottom-up design process that combines a number of entity sets that have the same features into a higher-level entity set.
- The design process proceeds 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, a person is the higher level entity set and customer and employee are lower level entity sets.
- A 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.
- 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:
- 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:
- 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.