Uploaded on Sep 10, 2026
The institute began its journey with its first branch at Nalstop, Pune, and has since expanded its presence across Pune and Mumbai, with six branches serving learners across the two cities. https://lipsindia.com/digital-marketing-course-in-pune-nalstop-wakad-kp-digital-marketing-program/
Top 5 Reasons To Do Digital Marketing Course After Graduation
This document is for private circulation only,
For Second Year BTech. Computer 2023-24
CCOEW students.
�Subject: Database Management Systems (DMS)
ACKNOWLEDGEMENT
• This presentation contains pictures, contents
taken from multiple sources, authors and sites.
• We would like to appreciate and thank the
authors, artists and do not claim any of following
work to be ours, but it has been compiled here to
use for academic purpose only.
So… how do we convert an ER
diagram into a table?? Simple!!
Basic Ideas:
⮚ Build a table for each entity set
⮚ Build a table for each relationship set if
necessary
⮚ Make a column in the table for each attribute in
the entity set
⮚ Primary Key
REVIEW - EXAMPLE
Attribute
tuple/relationa
l instance SID Name Major GPA Card
1234 John CS 2.8 inalit
5678 Mary EE 3.6 y =
2
4 Degree
A Schema / Relation
EXAMPLE – STRONG ENTITY SET
SID Name SSN Name
Student Advisor Professor
Major DeptGPA
SID Name Major GPA SSN Name Dept
1234 John CS 2.8 9999 Smith Math
5678 Mary EE 3.6 8888 Lee CS
REPRESENTATION OF WEAK
ENTITY SET
�Weak Entity Set Cannot exists alone
�To build a table/schema for weak entity set
⚫Construct a table with one column for each
attribute in the weak entity set
⚫Remember to include discriminator
⚫Augment one extra column on the right side of
the table, put in there the primary key of the
Strong Entity Set (the entity set that the weak
entity set is depending on)
⚫Primary Key of the weak entity set =
Discriminator + foreign key
EXAMPLE – WEAK ENTITY SET
Age
SID Name Nam
e
Parent own Children
s
Age Name Parent_SID
10 Bart 1234
8 Lisa 5678
* Primary key of Children is Parent_SID + Name
REPRESENTING RELATIONSHIP SET
UNARY/BINARY RELATIONSHIP
�For one-to-one relationship w/out total participation
⚫Build a table with two columns, one column for
each participating entity set’s primary key. Add
successive columns, one for each descriptive
attributes of the relationship set (if any).
�For one-to-one relationship with one entity set
having total participation
⚫Augment one extra column on the right side of
the table of the entity set with total participation,
put in there the primary key of the entity set
without complete participation as per to the
relationship.
EXAMPLE – ONE-TO-ONE RELATIONSHIP
SET
Degree
SID Name ID Code
Student study Major
Major GPA
SID Maj_ID Co S_Degree
9999 07 1234
8888 05 5678
* Primary key can be either SID or Maj_ID_Co
EXAMPLE – ONE-TO-ONE RELATIONSHIP SET
Condition
SID Name 1:1 S/N #
Relationship
Student Have Laptop
Major GPA Brand
SID Name Major GPA LP_S/N Hav_Cond
9999 Bart Economy -4.0 123-456 Own
8888 Lisa Physics 4.0 567-890 Loan
* Primary key can be either SID or LP_S/N
REPRESENTING RELATIONSHIP SET
UNARY/BINARY RELATIONSHIP
�For one-to-many relationship w/out
total participation
⚫ Same thing as one-to-one
�For one-to-many/many-to-one
relationship with one entity set having
total participation on “many” side
⚫ Augment one extra column on the right side of
the table of the entity set on the “many” side,
put in there the primary key of the entity set on
the “one” side as per to the relationship.
EXAMPLE – MANY-TO-ONE
RELATIONSHIP SET
Semester
SID Nam N:1 SSN
e Relationship
Student Advisor Professor
Major GPA Dept Name
SID Name Major GPA Pro_SSN Ad_Sem
9999 Bart Economy -4.0 123-456 Fall 2006
8888 Lisa Physics 4.0 567-890 Fall 2005
* Primary key of this table is SID
REPRESENTING RELATIONSHIP SET
UNARY/BINARY RELATIONSHIP
�For many-to-many relationship
⚫ Same thing as one-to-one relationship without
total participation.
⚫ Primary key of this new schema is the union of
the foreign keys of both entity sets.
⚫ No augmentation approach possible…
REPRESENTING RELATIONSHIP SET
N-ARY RELATIONSHIP
�Intuitively Simple
⚫Build a new table with as many columns as
there are attributes for the union of the
primary keys of all participating entity
sets.
⚫Augment additional columns for
descriptive attributes of the relationship
set (if necessary)
⚫The primary key of this table is the union
of all primary keys of entity sets that are
on “many” side
⚫That is it, we are done.
EXAMPLE – N-ARY RELATIONSHIP SET
P-Key1
D- A-Key
E-Set 1 Attribute
P-Key2 A relationship Another Set
E-Set 2
P-Key3
E-Set
3
P-Key1 P-Key2 P-Key3 A-Key D-Attribute
9999 8888 7777 6666 Yes
1234 5678 9012 3456 No
* Primary key of this table is P-Key1 + P-Key2 + P-Key3
REPRESENTING COMPOSITE
ATTRIBUTE
�Relational Model Indivisibility Rule Applies
�One column for each component attribute
�NO column for the composite attribute
itself
SSN Nam
e
SSN Name Street City
Professo 9999 Dr. Smith 50 1st St. Fake City
r 8888 Dr. Lee 1 B St. San Jose
Addres
s
Stree City
t
REPRESENTING MULTIVALUE ATTRIBUTE
�For each multivalue attribute in an entity
set/relationship set
⚫Build a new relation schema with two columns
⚫One column for the primary keys of the entity
set/relationship set that has the multivalue
attribute
⚫Another column for the multivalue attributes.
Each cell of this column holds only one value.
So each value is represented as an unique
tuple
⚫Primary key for this schema is the union of all
attributes
EXAMPLE – MULTIVALUE ATTRIBUTE
REPRESENTING CLASS HIERARCHY
�create a table for each super class entity set according to
normal entity set translation method.
�Create a table for each subclass entity set with a column
for each of the attributes of that entity set plus one for each
attributes of the primary key of the super class entity set
�This primary key from super class entity set is also used as
the primary key for this new table
SSN Name
EXAMPLE
Person
SID Status
Gender
ISA
Student
Major GPA
SSN Name Gender
1234 Homer Male
5678 Marge Female
SSN SID Status Major GPA
1234 9999 Full CS 2.8
5678 8888 Part EE 3.6
REPRESENTING AGGREGATION
Name SSN Name
Student Advisor Professor
Dept
SID
Name
member
Primary Key of Advisor
Dept
SID Code
Code
1234 04
Primary key of Dept
5678 08
Comments