EER (Enhanced Entity Relationship) Model
●
An EER (Enhanced Entity-Relationship) diagram is an extension of
the traditional ER (Entity-Relationship) diagram used in database
design.
●
It includes additional features such as attribute or relationship
inheritances, category or union types, specialization and
generalization, disjoint, overlapping, etc.
●
EER diagrams provide a more detailed and expressive way to model
complex data relationships compared to ER diagrams
Superclass and Subclass
●
In an Enhanced Entity-Relationship (EER) diagram, subclasses and superclasses
play a crucial role in organizing entities hierarchically. Here is a detailed
explanation with an example:
●
Superclass: A superclass represents a general concept at a higher level. It serves
as the parent entity from which one or more subclasses can be derived.
Superclasses are also known as base classes.
●
Subclass: A subclass represents a specific concept at a lower level. It is derived
from the superclass and inherits the properties of the superclass while also
containing its unique attributes. Subclasses are specialized versions of the
superclass.
eg
●
Consider a university management system, where students can be classified into different categories
based on their academic programs.
●
Superclass: Student
●
Common attributes: Student ID, First Name, Last Name, Email Address, Major, GPA
●
Subclasses:
●
Undergraduates
●
Unique attributes: Class Year, Cumulative Credit Hours
●
Graduates
●
Unique attributes: Degree Program, Expected Graduation Date
●
This setup demonstrates how subclasses inherit attributes and relationships from the superclass, but
they may also possess unique attributes and relationships tailored to their specific needs.
●
When updating or modifying attributes in the superclass, these updates will propagate to all subclasses
unless overridden by unique attributes in the subclasses themselves.
Generalization
●
Generalization in an EER (Enhanced Entity-Relationship) diagram is a
bottom-up approach where lower-level entities combine to form a higher-
level entity.
●
It involves synthesizing multiple entity sets into a higher-level entity set
based on common features.
●
In generalization, entities are combined to create a more generalized entity.
●
eg. saving and current account types entities can be generalized into an
entity named Account that encompasses both
Specialization
●
Specialization in an EER (Enhanced Entity-Relationship) diagram is a top-down approach of
dividing a higher-level entity into smaller, more specific entities based on their
characteristics.
●
It is the opposite of generalization, where a higher-level entity is divided into more specific
entities.
●
Specialization allows for the creation of unique attributes and relationships for each
subtype, improving data accuracy and consistency.
●
eg. For example, in a database containing information about employees, the entity
"Employee" can be specialized into "Permanent Employee" and "Temporary Employee,"
each with its unique attributes like "Salary" for Permanent Employee and "Contract
Duration" for Temporary Employee
Union
●
In an Enhanced Entity-Relationship (EER) diagram, a "union" represents a
combination of two or more entity types.
●
The union type can have attributes and relationships common to all the
entity types that make up the union.
●
It allows for the creation of an aggregate entity that represents a group of
entities as a single entity with unique attributes and relationships.
●
eg. in a database where an organization has an owner who can be a person,
a company, or a bank, the owner entity is considered a union of these
separate entity types