What is Generalization in DBMS?
We have already studied various features of the E-R model . As the data is growing the complexity of managing these data is also increasing. We can’t manage these data with the help of the traditional E-R data model. So to manage the increasing complexity we have designed an extended E-R Model. The extended E-R Model includes various concepts like Specialization, Generalization, Aggregation, etc. We have already covered Specialization in the last blog. In this blog, we will cover one of the topics of the extended E-R Model. i.e Generalization.
Generalization
Generalization, as the name suggests, is a process of generalizing two or more lower-level entity types into a higher-level entity type. Entities are clubbed or grouped together to represent a more generalized view. In this process, the common attributes of two or more entities combine to form a new entity type. The new entity type formed is called a generalized entity . It may be possible that this generalized entity may combine further with other entity types to form another higher-level entity type. It is a bottom-up approach . It is the reverse process of Specialization. For example, Whales, Sharks, and Dolphins can be generalized as Fish. Similarly, Bicycle, Bike, and Car can be generalized as Vehicles.
Example: Suppose we have two entity types, Employee and Customer.
The attributes of Employee entity type are Name, Phone, Salary, Employee_id, and Address .
The attributes of Customer entity type are Name, Phone, Address, Credit, Customer_id, and Email.
We can see that the three attributes i.e. Name, Phone, and Address are common here. When we generalize these two entities, we form a new higher-level entity type Person. The new entity type formed is a generalized entity. We can see in the below E-R diagram that after generalization the new generalized entity Person contains only the common attributes i.e. Name, Phone, and Address . Employee entity contains only the specialized attribute like Employee_id and Salary . Similarly, the Customer entity type contains only specialized attributes like Customer_id, Credit, and Email. So from this example, it is also clear that when we go from bottom to top, it is a Generalization and when we go from top to bottom it is Specialization. Hence, we can say that Generalization is the reverse of Specialization.
This is all about Generalization. Hope you learned something new today.
Do share this blog with your friends to spread the knowledge. Visit our YouTube channel for more content. You can read more blogs from here .
Keep Learning :)
Team AfterAcademy!