0% found this document useful (0 votes)
2 views11 pages

DBMS Lab Assignment 2

Uploaded by

annemskvp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views11 pages

DBMS Lab Assignment 2

Uploaded by

annemskvp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Department of Computer Science & Information Technology

DBMS Lab Assignment -2


Conversion of EER Model into Relational Model
The Extended Entity-Relationship Model is a more complex and high-level model that extends
an E-R diagram to include more types of abstraction, and to more clearly express constraints.
All of the concepts contained within an E-R diagram are included in the EE-R model, along
with additional concepts that cover more semantic information. These additional concepts
include generalization, specialization, and aggregation.

Generalization is a bottom-up approach in which two lower level entities combine to form a
higher level entity. In generalization, the higher level entity can also combine with other lower

level entity to make further higher level entity.


Specialization Generalization

Specialization is opposite to Generalization. It is a top-down approach in which one higher


level entity can be broken down into two lower level entities. In specialization, some higher
level entities may not have lower-level entity sets at all.

Conversion process for Generalization/ Specialization into Relational Schema:

• Create tables for all higher-level entities.

1
Department of Computer Science & Information Technology

• Create tables for lower-level entities.

• Add primary keys of higher-level entities in the table of lower-level entities.

• In lower-level tables, add all other attributes of lower-level entities.

• Declare primary key of higher-level table and the primary key for lower-level table.

• Declare foreign key constraints.

2
Department of Computer Science & Information Technology

3
Department of Computer Science & Information Technology

One limitation on ER model is that it cannot express relationships among relationships.


Aggregation provides best solution for this purpose. Aggregation is a process when relation
between two entities is treated as a single entity. To represent relationship set involving
aggregation of R, treat the aggregation like an entity set whose primary key is the primary key
of the table for R.

4
Department of Computer Science & Information Technology

5
Department of Computer Science & Information Technology

Assignment 2 Lab Questions

Theory Questions:-
Q.1 Explain the need of EER diagrams
Today the complexity of the data is increasing so it becomes more and more difficult to use
the traditional ER model for database modeling. To reduce this complexity of modeling we
have to make improvements or enhancements to the existing ER model to make it able to
handle the complex application in a better way.
Enhanced entity-relationship diagrams are advanced database diagrams very similar to
regular ER diagrams which represent the requirements and complexities of complex
databases.
It is a diagrammatic technique for displaying the Sub Class and Super Class; Specialization and
Generalization; Union or Category; Aggregation etc.

Q.2 Explain in detail Generalization, specialization and Aggregation and how do we


convert them into relational model

The process of generalizing entities that have the characteristics of all generalized items is
known as Generalization.
• It's a bottom approach, where a higher level entity is formed by combining two lower
level entities.
• The opposite of specialization is generalization.
• From a collection of specialized entity types, it defines a generic entity type.
• By highlighting the similarities between the entities, it reduces their differences.
The process of specialization creates group entities that are further subdivided according to
their characteristics.
• Because of the top-down methodology, two lower-level entities can be derived from a
single higher entity.
• By determining the special quality or qualities of each member, it maximizes the
differences between the members of an entity.
• It creates the relationship between the superclass and subclass and defines one or
more subclasses for the superclass.
The process of aggregation illustrates the connection between an object's constituent pieces
and its overall structure.
• It views a relationship between two items as an object and abstracts it.
• It's a procedure where two entities are handled as one.

6
Department of Computer Science & Information Technology

Conversion
Generalization and Specialization:
• Viewing connections between entities as though they were independent entities.
• Add more properties to the aggregated object by creating a new table.
• To connect the aggregated entity table to the original entities, use foreign keys.
Aggregation:
• Viewing connections between entities as though they were independent entities.
• Add more properties to the aggregated object by creating a new table.
• To connect the aggregated entity table to the original entities, use foreign keys.
Implementation Question:-
Q.1 Draw the EER for SIU library management and convert into relational model.

7
Department of Computer Science & Information Technology

INSTITUTE TABLE
Institute ID Institute Name

LIBRARY TABLE
Library ID Branch

BOOKS TABLE
Book ID Title Price

PEOPLE TABLE
Email Name Phone Number

STAFF TABLE
Staff ID Email Name Phone Number

MEMBER/STUDENT TABLE
Mem ID Email Name Phone Number

NAME Table
First Name Last Name

RESERVE TABLE
Mem ID Reserve Date Return Date Due Date

PUBLISHER TABLE
Publisher ID Publisher Name Publisher Phone Number

AUTHOR TABLE
Author ID Author Name

8
Department of Computer Science & Information Technology

Q.2 Convert following EER to relational model

PERSON TABLE
SSN Name DOB

001 Abhishek Rajput 20/01/2002

002 Jaya Rajput 20/02/2004

EMPLOYEE TABLE
SSN Department Salary

001 CS 20000

002 AIML 18000

9
Department of Computer Science & Information Technology

STUDENT TABLE
SSN StartDate GPA

001 04/02/2020 2.0

002 25/08/2021 8.0

SECRETARY TABLE
SSN Name
001 Abhishek

002 Jaya

TECHNICAL TABLE
SSN Name Specialization
001 Abhishek Web Dev

002 Jaya Java

FRESHNAME TABLE
SSN Name
001 Abhishek

002 Jaya

JUNIOR TABLE
SSN Name Major
001 Abhishek Commerce

002 Jaya Science

SENIOR TABLE
SSN Name Major Advisor
001 Abhishek Commerce Python

002 Jaya Science C++

10
Department of Computer Science & Information Technology

SOPHOMORE TABLE
SSN Name Major
001 Abhishek Commerce

002 Jaya Science

11

You might also like