Lecture 03 Transformation of Erd To Rdbms
Lecture 03 Transformation of Erd To Rdbms
ER to Relational Model
Transformation
Involves the transformation of the ER diagram to a complete
database scheme
Entity set in the ER model become tables in a relational
database
The relationships become the source of foreign keys that
integrate the resulting table together
Based on the mapping cardinalities & entity participation of
the relationship
hours
deptname
empid
deptid
name
hours
deptname
empid
name deptid
Employee(empid,name)
department(deptid,deptname)
works(empid,deptid,hours)
hours
deptname
empid
deptid
name
Employee(empid,name)
department(deptid,deptname)
MIS 106 Advance Data Management
Rule 3
One-to-many, optional on the many side regardless of entity
participation on the “1” side
hours
deptname
empid
name deptid
Employee(empid,name)
department(deptid,deptname)
works(empid,deptid,hours)
MIS 106
hours
deptname
empid
deptid
name
hours
deptname
empid
deptid
name
Employee(empid,name, hours)
department(deptid,deptname)
hours
deptname
empid
deptid
name
Employee(empid,name)
department(deptid,deptname)
works(empid,deptid,hours)
MIS 106 Advance Data Management
Transform the ER Diagram into a
Relational Schema
deptid deptname
works for
DEPARTMENT
empid
name
manages
EMPLOYEE
address
bdate
projid
works on
PROJECT
projname
hours
name projid
works on
EMPLOYEE PROJECT
address projname
hours
bdate
EMPLOYEE(empid,name,address,bdate)
PROJECT(projid,projname)
WORKS(empid,projid,hours)
MIS 106
Next
empid
deptid
name
works for
EMPLOYEE DEPARTMENT
deptname
address
bdate
EMPLOYEE(empid,name,address,bdate,deptid)
DEPARTMENT(deptid,deptname)
deptid
name
manages
EMPLOYEE DEPARTMENT
deptname
address
bdate
EMPLOYEE(empid,name,address,bdate)
DEPARTMENT(deptid,deptname,empid)
Any question?