Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Enhanced ER Model, three new concepts were added to the existing ER Model, they

were:
1. Generalization
2. Specialization
3. Aggregration
Generalization is the process of extracting shared characteristics from two or more
classes, and combining them into a generalized superclass. Shared characteristics can be
attributes, associations, or methods.specialization means creating new subclasses from
an existing class. If it turns out that certain attributes, associations, or methods only
apply to some of the objects of the class, a subclass can be created.

Generalization
Generalization is the result of taking the union of two or more disjoint(lower-level)
entity sets to produce a higher-level entity-set.

Generalization is the process of extracting common properties from a set of entities and
create a generalized entity from it.

It is a bottom-up approach in which two or more lower level entities can be


combine(generalized) to a higher level entity if they have some attributes in common.

The higher level entity can also combine with other lower level entities to make further
higher level entity.

It's more like Superclass and Subclass system, but the only difference is the approach,
which is bottom-up. Hence, entities are combined to form a more generalised entity, in
other words, sub-classes are combined to form a super-class.

For example, Saving and Current account types entities can be generalised and an entity
with name Account can be created, which covers both.
Specialization
Specialization is opposite to Generalization. Specialization is a process in which an entity
is divided into sub-entities based on their characteristics.

Specialization is a process of taking a subset of a higher level entity set to form a


lower-level entity set.

It is the process of designating subgroupings within an entity set.

Specialization is a top-down approach in which a higher-level entity is divided into


multiple specialized lower-level entities.

In specialization, a higher level entity may not have any lower-level entity sets, it's
possible.

In addition to sharing the attributes of the higher-level entity, these lower-level entities
have specific attributes of their own.
The following enhanced entity relationship diagram expresses the entities in a
hierarchical database to demonstrate specialization:

For Example, EMPLOYEE entity in an Employee management system can be specialized


into DEVELOPER, TESTER etc. as shown in Figure 2. In this case, common attributes like
E_NAME, E_SAL etc. become part of higher entity (EMPLOYEE) and specialized
attributes like TES_TYPE become part of specialized entity (TESTER).
Aggregration
Aggregration is a process when relation between two entities is treated as a single
entity.

In the diagram above, the relationship between Center and Course together, is acting as
an Entity, which is in relationship with another entity Visitor. Now in real world, if a
Visitor or a Student visits a Coaching Center, he/she will never enquire about the center
only or just about the course, rather he/she will ask enquire about both

An ER diagram is not capable of representing relationship between an entity and a


relationship which may be required in some scenarios. In those cases, a relationship
with its corresponding entities is aggregated into a higher level entity.

For Example, Employee working for a project may require some machinery. So,
REQUIRE relationship is needed between relationship WORKS_FOR and entity
MACHINERY. Using aggregation, WORKS_FOR relationship with its entities EMPLOYEE
and PROJECT is aggregated into single entity and relationship REQUIRE is created
between aggregated entity and MACHINERY.
keys in DBMS:

Key plays an important role in relational database; it is used for identifying unique rows
from table. It also establishes relationship among tables.
Types of keys in DBMS

Primary Key – A primary key is a column or set of columns in a table that uniquely
identifies tuples (rows) in that table selected by the admin(DBA)

Super Key – A super key is a set of one of more columns (attributes) to uniquely identify
rows in a table.

Candidate Key – A super key with no redundant attribute is known as candidate key

Alternate Key – Out of all candidate keys, only one gets selected as primary key,
remaining keys are known as alternate or secondary keys.

Composite Key – A key that consists of more than one attribute to uniquely identify rows
(also known as records & tuples) in a table is called composite key.

Foreign Key – Foreign keys are the columns of a table that points to the primary key of
another table. They act as a cross-reference between tables.

Example: An entity is Student having field name (attributes) s_roll,s_name and


s_address.
Then,
Superkey-(s_roll),
( s_name,s_address),
(s_roll,s_name)
Candidatekey-minimal subset of superkey
(s_roll),
( s_name,s_address),
(s_roll,s_name) [Because s_roll itslef can uniquely identify a tuple in Student
entity table.So, here s_address is redundant as key attribute and hence this
combination of attributes is not minimal subset of super key.

Primary Key: Any one of the candidate keys can be a Primary key that is choosen by the
DBA(Database Administrator) or admin of the database.

Composite Key: Here ( s_name,s_address) is an example of Composite key.

Alternate Key: Excluding the Primary key all other candidate keys are called alternate
key of the table(entity),’Student’.

Foreign key: If a primary key (for example S_roll of ‘Student ‘ entity) is a reference key of
any other table or entity in order to manipulate(such as retrieval of information)the
information of database,then the key is called Foreign key of later(2nd) table referred
by 1st table(here ‘Student’ table).

You might also like