An ER Diagram Is A Pictorial Representation of The Information That Can Be Captured by A Database. Such A "Picture" Serves Two Purposes
An ER Diagram Is A Pictorial Representation of The Information That Can Be Captured by A Database. Such A "Picture" Serves Two Purposes
An ER Diagram Is A Pictorial Representation of The Information That Can Be Captured by A Database. Such A "Picture" Serves Two Purposes
Student
Student Table
USN Name DOB
Primary
1BM14CS001 Aditya 1-1-1997
Key
1BM14CS002 Bharath 31-12-1996
Faculty Dependents_of
Dependent
Owner
Identifying Weak
Entity
Relationship Entity
Faculty Dependents_of
Dependent
Owner
Identifying Weak
Entity
Relationship Entity
D-ID
F-ID 1
1
F-Name
D-Name
F-Name
D-Name
F-Name
D-Name
F-Name
D-Name
Approach 2: Merged Relation approach
Merging two entity types and relationship into one single relation.
This may be appropriate when both participations are total
F-Name
D-Name
Approach 3: Cross-reference or relationship relation approach
USN
D-ID M
Departme 1 Student
Has
nt
D-Name
S-Name
USN C-ID
Enrolls_for
Student Course
S-Name C-Name
Thursday, July 01, 2021 CSE, KLEF 14
Converting ER diagram to Tables
• Relationship: Many-to-Many
USN C-ID
Enrolls_for
Student Course
S-Name C-Name
Mobile
Student
Mobile
Student
Which of the following representation of the table for Multivalued
Attribute is best ?
USN Name DOB Mobile 1 Mobile 2
1BM14CS001 Aditya 1-1-1997 8766655433
Mobile Table
Student Table
USN Mobile
USN Name DOB
1BM14CS001 8766655433
1BM14CS001 Aditya 1-1-1997
1BM14CS002 9762255433
1BM14CS002 Bharath 31-12-1996
1BM14CS002 7066722433
If you have a multi-valued attribute, take the attribute and turn it into a
new entity or table of its own. Then make a 1:N relationship between
the new entity and the existing one. In simple words,
1. Create a table for the attribute.
2. Add the primary (id) column of the parent entity as a foreign key
within the new table
Thursday, July 01, 2021 CSE, KLEF 19
Converting ER diagram to Tables
Street Area
Name Name
• Composite Attribute
Address Place
USN DOB
Name
Student Mobile
Student Mobile
Student Table
USN Name DOB Street Area Place
1BM14CS001 Aditya 1-1-1997 RK Road Nagar Mandya
USN Mobile
Mobile Table 1BM14CS001 8766655433
1BM14CS002 9762255433
1BM14CS002 7066722433
Thursday, July 01, 2021 CSE, KLEF 21
Converting ER diagram to Tables
Street Area
Name Name
Student Table
USN Name DOB Street Area Place
1BM14CS001 Aditya 1-1-1997 RK Road Nagar Mandya
USN Mobile
1BM14CS001 8766655433
1BM14CS002 7066722433