Generalization in DBMS with Example: An extended ER diagram has features such as Specialization, Generalization, and Aggregation. In the previous tutorial, we have covered Specialization. Now, let us proceed to learn Generalization.

Also See: Structure of DBMS

Generalization is an abstraction process of viewing the set of objects as a single – general class which follows a bottom-up approach. It can also be stated as a process where two or more low-level entities are combined to form higher-level entities. Subclasses are combined to form a superclass I. e subclasses entities are combined to form a more generalized entity where common attributes or fields of two or more entities club to form one single entity type.

Also See: What is Schedule in DBMS? Types, Advantages, Disadvantages

Generalization in DBMS with Example

Let us learn with the Example shown below. You might have noticed below, this follows the Bottom-top approach, an exact reverse process of Specialization.

Generalization in DBMS
Generalization in DBMS

Let us start with the bottom. Consider three categories of Employee FULLTIME, PARTTIME, ADHOC which have common attributes and specialized attributes. For instance, in the above diagram, FULLTIME employee has a special attribute designation, PARTTIME employee two special attributes namely number of days and task, ADHOC has hours as its special attribute. All these three sub-entities can be generalized as a super-entity called EMPLOYEE because ultimately all three types – fulltime, partime and adhoc are types of employees. And thereby the common attribute will be present for EMPLOYEE – super-entity and not the child entity since it makes more sense for a parent entity to have a common attribute and child attributes have their own special attributes which are not present in other entities.

Also See: TCL Commands in SQL- Transaction Control Language Examples

Moving a step up, you notice that there are two classes EMPLOYEE and a STUDENT having employee id and student id respectively as their own special attributes. Both of these entities can be generalized into a parent entity called Person because ultimately employee and student are a Person. And the common attributes are name, email, and address which are specific to PERSON, and by default subclasses have these common attributes.

Other examples of Generalization are:

  • A Car, Bike, and Truck – all three are certainly different types of vehicles but can be generalized into one single entity as Vehicle.
  • A Developer and a Tester, both are different sub-entities having some special attributes which can be clubbed into single-general super-entity Employee.
  • A part-time and full-time employee in an organization can be generalized as an Employee itself where part-time and full-time employees are sub-entities and an Employee is a parent entity.
  • With emerging technologies, we have moved from using conventional phones or telephones to using mobile phones, which can be considered as sub-entities that can be generalized to a superclass Phone entity.

Also See: SQL – INSERT INTO STATEMENT

So it was all about generalization in DBMS, if you have any question then please comment below.

Sumit ThakurWhat Is DBMSGeneralization in DBMS with Example: An extended ER diagram has features such as Specialization, Generalization, and Aggregation. In the previous tutorial, we have covered Specialization. Now, let us proceed to learn Generalization. Also See: Structure of DBMS Generalization is an abstraction process of viewing the set of objects as a single...Let's Define DBMS