SlideShare a Scribd company logo
Conversion of ER model to Relational Model
4 Credit
Chapter Contents
 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

PDF
Dbms 10: Conversion of ER model to Relational Model
PPTX
Entity-Relationship Diagram (ERD) Material.pptx
PPTX
Entity relationship Models from Chapter 4
PPTX
Entity Relationship Model in Database System
PPTX
database.pptx
PPT
18306_lec-2 (1).ppt
PPTX
Entity Relationship Diagram – ER Diagram in DBMS.pptx
PDF
Unit 2 DBMS
Dbms 10: Conversion of ER model to Relational Model
Entity-Relationship Diagram (ERD) Material.pptx
Entity relationship Models from Chapter 4
Entity Relationship Model in Database System
database.pptx
18306_lec-2 (1).ppt
Entity Relationship Diagram – ER Diagram in DBMS.pptx
Unit 2 DBMS

Similar to DBMS Conversion of ERD to relational model-1 (20)

PPTX
Entity Relationship Diagram – ER Diagram in DBMS.pptx
PPTX
DBMS: ER Model Basics with a good description
PDF
DBMS seminar.pdf mapping eer model to relational model
PPTX
Database part3-
PPTX
ECEG 4702-Class7-Entity-Relationship modeling.pptx
PPTX
Entity relationship model
PPT
Ch 6
PPTX
Er model
PPTX
Er diagrams presentation
PPTX
Er diagrams presentation
PDF
RDBMS ER2 Relational
PPTX
logical data base design ,data base , .pptx
PPTX
DBMS - ER Model
PDF
erdiagramspresentation-150826044953-lva1-app6891.pdf
PPTX
Unit 1 Data Modeling_Updated (2) (2).pptx
PPT
DatabasesAndDatawarehousingconcepts1.ppt
PPTX
Relational model
PPTX
Relational model
PPTX
Database Management System DBMS ER diagram.
Entity Relationship Diagram – ER Diagram in DBMS.pptx
DBMS: ER Model Basics with a good description
DBMS seminar.pdf mapping eer model to relational model
Database part3-
ECEG 4702-Class7-Entity-Relationship modeling.pptx
Entity relationship model
Ch 6
Er model
Er diagrams presentation
Er diagrams presentation
RDBMS ER2 Relational
logical data base design ,data base , .pptx
DBMS - ER Model
erdiagramspresentation-150826044953-lva1-app6891.pdf
Unit 1 Data Modeling_Updated (2) (2).pptx
DatabasesAndDatawarehousingconcepts1.ppt
Relational model
Relational model
Database Management System DBMS ER diagram.
Ad

Recently uploaded (20)

PPTX
GDM (1) (1).pptx small presentation for students
PDF
Pre independence Education in Inndia.pdf
PPTX
master seminar digital applications in india
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
RMMM.pdf make it easy to upload and study
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Lesson notes of climatology university.
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Basic Mud Logging Guide for educational purpose
PDF
Classroom Observation Tools for Teachers
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
GDM (1) (1).pptx small presentation for students
Pre independence Education in Inndia.pdf
master seminar digital applications in india
Supply Chain Operations Speaking Notes -ICLT Program
O5-L3 Freight Transport Ops (International) V1.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Microbial diseases, their pathogenesis and prophylaxis
RMMM.pdf make it easy to upload and study
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Lesson notes of climatology university.
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Basic Mud Logging Guide for educational purpose
Classroom Observation Tools for Teachers
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
01-Introduction-to-Information-Management.pdf
Final Presentation General Medicine 03-08-2024.pptx
Anesthesia in Laparoscopic Surgery in India
Ad

DBMS Conversion of ERD to relational model-1

  • 1. Conversion of ER model to Relational Model 4 Credit
  • 2. Chapter Contents  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