ER-Diagram:: To Implement. Database Design Using ER Modeling, Normalization and Implementation For Any Application

You might also like

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

CS8481-Database Management Systems Lab Department of CSE 2020-2021

AIM:

To implement. database design using ER modeling, normalization and implementation for


any application
ER- Diagram :

It is an Entity –Relationship diagram which is used to represent the relationship between


different entities. An entity is an object in the real world which is distinguishable from
other objects. The overall logical structure of a database can be expressed graphically by an
ER diagram, which is built up from following components.
Rectangles: represent entity sets.
Ellipses: represent attributes.
Diamonds: represent relationships among entity sets.
Lines: link attribute to entity sets and entity sets to relationships.

Mapping Cardinalities :

It expresses the number of entities to which another entity can be associated via a
relationship set. For a binary relationship set R between entity sets A and B. The Mapping
Cardinalities must be one of the following.
• One to one

• One to many

• Many to one

• Many to many

Consider the following schema for a Library Database:

BOOK (Book_id, Title, Publisher_Name, Pub_Year)

BOOK_AUTHORS (Book_id, Author_Name)

PUBLISHER (Name, Address, Phone)

BOOK_COPIES (Book_id, Branch_id, No-of_Copies)

BOOK_LENDING (Book_id, Branch_id, Card_No, Date_Out, Due_Date)

LIBRARY_BRANCH (Branch_id, Branch_Name, Address)

St.Joseph’s College of Engineering 36


CS8481-Database Management Systems Lab Department of CSE 2020-2021

ER DIAGRAM

St.Joseph’s College of Engineering 37


CS8481-Database Management Systems Lab Department of CSE 2020-2021

Consider the below Health History Report and do the normalization

UNF:
invoice [ invoice_no, invoice_date, cust_name, cust_addr, ( pet_name,
procedure, amount ) ]
1NF:
invoice [ invoice_no, invoice_date, cust_name, cust_addr ]
invoice_pet [ invoice_no, pet_id, pet_name, procedure, amount ]

note: pet_id was chose as a key because pet_name is a character string and
not a good key candidate.

2NF:
invoice [ invoice_no, invoice_date, cust_name, cust_addr ]
invoice_pet [ invoice_no, pet_id, procedure, amount ]
pet [ pet_id, pet_name ]

3NF:
invoice [ invoice_no, invoice_date, cust_no (FK) ]
invoice_pet [ invoice_no (FK), pet_id (FK), procedure, amount ]
pet [ pet_id, pet_name ]
customer [ cust_no, cust_name, cust_street, cust_city, cust_pstlcd ]

note: cust_no was chose as a key because cust_name is a character string and
not a good key candidate. The customer address was broken apart in 3NF. All
foreign keys are identified.

RESULT:

Thus for an application ER modeling and normalization is executed successfully.

St.Joseph’s College of Engineering 38

You might also like