My ER and EER-to-Relation Mapping
My ER and EER-to-Relation Mapping
Relational
Mapping
Chap 7
5th Edition
By Shweta Wadhera
Assistant Professor ( C.S )
DDUC
We will see that how we will create different tables from ER
diagram .
The different elements of the ER diagram are :-
Entity ( Strong )
Weak Entity
Attributes
Multivalued Attributes
Composite Attributes
Relationships
One : One
One : Many
Many : Many
Mapping ER –Diagram to Relation
Eid
Name
Employee
(Eid,Name,Address,DOB,Salary)
EMPLOYEE
DOB Salary
Address
Mapping for Composite Attributes
Eid
Employee
Name
(Eid,Name,Hno,Street,Locality,
DOB,Salary)
EMPLOYEE
DOB Salary
Address
Street
Hno Locality
Mapping for Multivalued Attributes
E-R Diagram Relations Formed
EMPLOYEE
Emp-degrees
( Eid ,Degree )
DOB
Address
Degrees
Employee Emp-Dependent
(Eid,Name,Address,DOB,Salary) (Eid , Name , BirthDt,
Relationship )
What if we keep all dependents in the Employee table itself ?
Attributes of Relationship Type
StartDt
1 1
EMPLOYEE Manages DEPARTMENT
DoJ
Eid Dnum Location
Name
N 1
Works
EMPLOYEE IN DEPARTMENT
M N
EMPLOYEE Joins IN PROJECT
DOB Salary
Address Budget
Relations formed …..
Name
Eid
Supervisor
EMPLOYEE Supervises
DOB
Supervisee
Address
Salary
Relation
PLUS
PLUS
Essn
Jobtype
EMPLOYEE
Jobtype
d
Typing
Speed Etype
TGrade
- This option works well only when both the disjoint and
Total participation by subclasses .
VEHICLE
No of
Passengers d No of
Max Axles
Speed
CAR TRUCK
Essn Jobtype
EMPLOYEE
Jobtype
Secretary d Engineer
Typing
Speed Etype
TGrade
Technician
SECRETARY ENGINEER
TECHNICIAN
Description
Part No
PART
List Price
Batch No
Mfd Dt
O Supplier
Name