SlideShare a Scribd company logo
3
Most read
4
Most read
5
Most read
Dr. Amiya Ranjan Panda
Assistant Professor [II]
School of Computer Engineering,
Kalinga Institute of Industrial Technology (KIIT),
Deemed to be University,Odisha
Conversion of ER model to Relational Model
KALINGA INSTITUTE OF INDUSTRIAL
TECHNOLOGY
School Of Computer
Engineering
4 Credit Lecture Note 10
Chapter Contents
q Conversion of ER model to Relational Model
2
3
Conversion of ER model to Relational Model
A database that conforms to an ER diagram schema can be represented by a
collection of relational schemas. Both the ER model and Relational data model are
abstract, logical representations of real-world enterprises…
1. Representation of Strong Entity sets: A strong entity set reduces to a schema
with the same attributes. The primary key of the entity set serves as the primary
key of the resulting schema.
Loan = (loan_no, amount)
4
Conversion of ER model to Relational Model
2. Representation of Weak Entity sets: A weak entity set becomes a table that
includes a column for the primary key of the identifying strong entity set. The
primary key is constructed by the collection of foreign key and partial key.
Loan = (loan_no, amount)
Payment = (loan_no, payment_no, payment_date,
payment_amt)
5
Conversion of ER model to Relational Model
3. Representation of Relationship sets :
3. (a) Binary M:N: Union of the primary key attributes from the
participating entity sets becomes the primary key of the relationship.
Customer = (cid, cname, address) Loan = (loan_no, amount)
Borrow = (cid, loan_no)
If borrow_date is mentioned as descriptive attribute, then
Borrow = (cid, loan_no, borrow_date)
6
Conversion of ER model to Relational Model
3. Representation of Relationship sets :
3. (b) Binary M:1 / 1:M : Construct two tables, one for the entity set at 1
side and another for entity set at M side, add the descriptive attributes and
a reference of the primary key of 1 side to the entity set at M side.
Stud = (roll, name, branch) Library = (bid, bname, price,
roll)
The foreign key can be represented by specifying the name as:
Library = (bid, bname, price, borrowing_roll)
If borrow_date is the descriptive attribute, then
Library = (bid, bname, price, borrowing_roll, borrow_date)
7
Conversion of ER model to Relational Model
3. Representation of Relationship sets :
3. (c) Binary 1:1 : Construct two tables. In this case, either side can be
chosen to act as the many side. That is, extra attributes can be added to
either of the tables corresponding to the two entity sets, but not at the same
time.
Employee = (eid, ename, address, did) Department = (did, dname, location)
If it is required to mention the relationship name, then
Employee = (eid, ename, address, manager_did)
If department entity set will be considered as many side, then
Employee = (eid, ename, address) Department = (did, dname, location,
manager_eid)
8
Conversion of ER model to Relational Model
4. Representation of Recursive Relationship sets : Two tables will be
constructed; one for entity set and one for relationship set.
Employee = (eid, ename, address) Works_for = (mgrid, workerid)
This ER diagram can also be represented by using a single relation schema. In such
cases, the schema contains a foreign key for each tuple in the original entity set
Employee = (eid, ename, address, manager_id)
9
Conversion of ER model to Relational Model
5. Representation of Composite attributes : The composite attributes are
flattened out by creating a separate attribute for each of its parts.
Customer = (cid, name, address_street, address_city, address_pin)
10
Conversion of ER model to Relational Model
6. Representation of Multi-valued attributes: A multi-valued attribute M of an
entity set E is represented by a separate schema E_M as E_M (primary key of E,
M).
Employee = (eid, name, address) Employee_phone_no = (eid, phone_no)
11
Conversion of ER model to Relational Model
7. Representation of Generalization / Specialization : In case of
generalization/specialization-related ER diagram, one schema will be
constructed for the generalized entity set and the schemas for each of the
specialized entity sets.
Person = (person_id, name, address) Employee = (person_id, salary)
Customer = (person_id, credit_rating)
When the generalization/specialization is a disjointness case, the schemas are
constructed only for the specialized entity sets
Employee = (employee_id, name, address, salary) Customer =
(customer_id, name, address, credit_rating)
12
Conversion of ER model to Relational Model
8. Representation of Aggregation : To represent aggregation, create a schema
containing the primary key of the aggregated relationship, primary key of the
associated entity set and descriptive attributes (if any).
Employee = (eid, name, address) Branch = (bid, bname, asset)
Job = (jobid, position, responsibility) Works_on = (eid, bid, jobid) Manager = (mid,
mgrname)
Manages = (eid, bid, jobid, mid)
13

More Related Content

PPT
Database design
PPTX
Database : Relational Data Model
PPTX
ER Modeling and Introduction to RDBMS
PPT
Enhanced E-R diagram
PPTX
ER DIAGRAM & ER MODELING IN DBMS
PPT
Data modeling using the entity relationship model
PPTX
Er diagram
PPTX
Logical database design and the relational model(database)
Database design
Database : Relational Data Model
ER Modeling and Introduction to RDBMS
Enhanced E-R diagram
ER DIAGRAM & ER MODELING IN DBMS
Data modeling using the entity relationship model
Er diagram
Logical database design and the relational model(database)

What's hot (20)

PPTX
B and B+ tree
PPTX
SQL - Structured query language introduction
PPTX
SQL Queries Information
PPTX
Binary Search Tree
PPTX
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
PPT
1. Introduction to DBMS
PPTX
Linked list
PDF
Enhanced Entity-Relationship (EER) Modeling
ODP
ER Model in DBMS
PPTX
Union in c language
PPTX
2D Array
PPTX
Arrays In C++
PPSX
Functional dependency
PPTX
Types Of Keys in DBMS
PPTX
Arrays in Data Structure and Algorithm
ODP
Relationship Types of degree higher than 2
PPTX
Lab2 ddl commands
PPT
UNIT-4 TREES.ppt
PPTX
Data types in java
PPT
Coupling and cohesion
B and B+ tree
SQL - Structured query language introduction
SQL Queries Information
Binary Search Tree
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
1. Introduction to DBMS
Linked list
Enhanced Entity-Relationship (EER) Modeling
ER Model in DBMS
Union in c language
2D Array
Arrays In C++
Functional dependency
Types Of Keys in DBMS
Arrays in Data Structure and Algorithm
Relationship Types of degree higher than 2
Lab2 ddl commands
UNIT-4 TREES.ppt
Data types in java
Coupling and cohesion
Ad

Similar to Dbms 10: Conversion of ER model to Relational Model (20)

PPTX
DBMS conversion of ERD to RElational model
PPTX
DBMS Conversion of ERD to relational model-1
PPTX
Entity Relationship Diagram – ER Diagram in DBMS.pptx
PDF
Unit 2 DBMS
PPTX
Entity-Relationship Diagram (ERD) Material.pptx
PPTX
Entity Relationship Model in Database System
PPTX
DBMS: ER Model Basics with a good description
PPT
18306_lec-2 (1).ppt
PPTX
Entity Relationship Diagram – ER Diagram in DBMS.pptx
PPT
Ch 6
PDF
DBMS seminar.pdf mapping eer model to relational model
PPTX
Entity relationship Models from Chapter 4
PPTX
database.pptx
PPTX
Database part3-
PPTX
er-models.pptx
PPTX
Entity relationship model
PDF
Advantages and disadvantages of er model in DBMS. Types of database models ..
PPTX
Er model
PPTX
ECEG 4702-Class7-Entity-Relationship modeling.pptx
DBMS conversion of ERD to RElational model
DBMS Conversion of ERD to relational model-1
Entity Relationship Diagram – ER Diagram in DBMS.pptx
Unit 2 DBMS
Entity-Relationship Diagram (ERD) Material.pptx
Entity Relationship Model in Database System
DBMS: ER Model Basics with a good description
18306_lec-2 (1).ppt
Entity Relationship Diagram – ER Diagram in DBMS.pptx
Ch 6
DBMS seminar.pdf mapping eer model to relational model
Entity relationship Models from Chapter 4
database.pptx
Database part3-
er-models.pptx
Entity relationship model
Advantages and disadvantages of er model in DBMS. Types of database models ..
Er model
ECEG 4702-Class7-Entity-Relationship modeling.pptx
Ad

More from Amiya9439793168 (11)

PDF
Dbms 14: Relational Calculus
PDF
Dbms 13: Query Using Relational Algebra
PDF
Dbms 12: Join
PDF
Dbms 11: Relational Algebra
PDF
Dbms 9: Relational Model
PDF
Dbms 8: Enhanced ER Model
PDF
Dbms 6: ER Modeling
PDF
Dbms 3: 3 Schema Architecture
PDF
Dbms 2: Data Model
PDF
Introduction to Database Management System
PDF
Dbms 7: ER Diagram Design Issue
Dbms 14: Relational Calculus
Dbms 13: Query Using Relational Algebra
Dbms 12: Join
Dbms 11: Relational Algebra
Dbms 9: Relational Model
Dbms 8: Enhanced ER Model
Dbms 6: ER Modeling
Dbms 3: 3 Schema Architecture
Dbms 2: Data Model
Introduction to Database Management System
Dbms 7: ER Diagram Design Issue

Recently uploaded (20)

DOCX
573137875-Attendance-Management-System-original
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
Geodesy 1.pptx...............................................
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
web development for engineering and engineering
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
PPT on Performance Review to get promotions
PPT
Project quality management in manufacturing
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Sustainable Sites - Green Building Construction
PDF
Structs to JSON How Go Powers REST APIs.pdf
573137875-Attendance-Management-System-original
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
CH1 Production IntroductoryConcepts.pptx
Lesson 3_Tessellation.pptx finite Mathematics
Geodesy 1.pptx...............................................
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
UNIT-1 - COAL BASED THERMAL POWER PLANTS
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
web development for engineering and engineering
Foundation to blockchain - A guide to Blockchain Tech
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPT on Performance Review to get promotions
Project quality management in manufacturing
CYBER-CRIMES AND SECURITY A guide to understanding
UNIT 4 Total Quality Management .pptx
Sustainable Sites - Green Building Construction
Structs to JSON How Go Powers REST APIs.pdf

Dbms 10: Conversion of ER model to Relational Model

  • 1. Dr. Amiya Ranjan Panda Assistant Professor [II] School of Computer Engineering, Kalinga Institute of Industrial Technology (KIIT), Deemed to be University,Odisha Conversion of ER model to Relational Model KALINGA INSTITUTE OF INDUSTRIAL TECHNOLOGY School Of Computer Engineering 4 Credit Lecture Note 10
  • 2. Chapter Contents q Conversion of ER model to Relational Model 2
  • 3. 3 Conversion of ER model to Relational Model A database that conforms to an ER diagram schema can be represented by a collection of relational schemas. Both the ER model and Relational data model are abstract, logical representations of real-world enterprises… 1. Representation of Strong Entity sets: A strong entity set reduces to a schema with the same attributes. The primary key of the entity set serves as the primary key of the resulting schema. Loan = (loan_no, amount)
  • 4. 4 Conversion of ER model to Relational Model 2. Representation of Weak Entity sets: A weak entity set becomes a table that includes a column for the primary key of the identifying strong entity set. The primary key is constructed by the collection of foreign key and partial key. Loan = (loan_no, amount) Payment = (loan_no, payment_no, payment_date, payment_amt)
  • 5. 5 Conversion of ER model to Relational Model 3. Representation of Relationship sets : 3. (a) Binary M:N: Union of the primary key attributes from the participating entity sets becomes the primary key of the relationship. Customer = (cid, cname, address) Loan = (loan_no, amount) Borrow = (cid, loan_no) If borrow_date is mentioned as descriptive attribute, then Borrow = (cid, loan_no, borrow_date)
  • 6. 6 Conversion of ER model to Relational Model 3. Representation of Relationship sets : 3. (b) Binary M:1 / 1:M : Construct two tables, one for the entity set at 1 side and another for entity set at M side, add the descriptive attributes and a reference of the primary key of 1 side to the entity set at M side. Stud = (roll, name, branch) Library = (bid, bname, price, roll) The foreign key can be represented by specifying the name as: Library = (bid, bname, price, borrowing_roll) If borrow_date is the descriptive attribute, then Library = (bid, bname, price, borrowing_roll, borrow_date)
  • 7. 7 Conversion of ER model to Relational Model 3. Representation of Relationship sets : 3. (c) Binary 1:1 : Construct two tables. In this case, either side can be chosen to act as the many side. That is, extra attributes can be added to either of the tables corresponding to the two entity sets, but not at the same time. Employee = (eid, ename, address, did) Department = (did, dname, location) If it is required to mention the relationship name, then Employee = (eid, ename, address, manager_did) If department entity set will be considered as many side, then Employee = (eid, ename, address) Department = (did, dname, location, manager_eid)
  • 8. 8 Conversion of ER model to Relational Model 4. Representation of Recursive Relationship sets : Two tables will be constructed; one for entity set and one for relationship set. Employee = (eid, ename, address) Works_for = (mgrid, workerid) This ER diagram can also be represented by using a single relation schema. In such cases, the schema contains a foreign key for each tuple in the original entity set Employee = (eid, ename, address, manager_id)
  • 9. 9 Conversion of ER model to Relational Model 5. Representation of Composite attributes : The composite attributes are flattened out by creating a separate attribute for each of its parts. Customer = (cid, name, address_street, address_city, address_pin)
  • 10. 10 Conversion of ER model to Relational Model 6. Representation of Multi-valued attributes: A multi-valued attribute M of an entity set E is represented by a separate schema E_M as E_M (primary key of E, M). Employee = (eid, name, address) Employee_phone_no = (eid, phone_no)
  • 11. 11 Conversion of ER model to Relational Model 7. Representation of Generalization / Specialization : In case of generalization/specialization-related ER diagram, one schema will be constructed for the generalized entity set and the schemas for each of the specialized entity sets. Person = (person_id, name, address) Employee = (person_id, salary) Customer = (person_id, credit_rating) When the generalization/specialization is a disjointness case, the schemas are constructed only for the specialized entity sets Employee = (employee_id, name, address, salary) Customer = (customer_id, name, address, credit_rating)
  • 12. 12 Conversion of ER model to Relational Model 8. Representation of Aggregation : To represent aggregation, create a schema containing the primary key of the aggregated relationship, primary key of the associated entity set and descriptive attributes (if any). Employee = (eid, name, address) Branch = (bid, bname, asset) Job = (jobid, position, responsibility) Works_on = (eid, bid, jobid) Manager = (mid, mgrname) Manages = (eid, bid, jobid, mid)
  • 13. 13