Upload
oum-saokosal
View
421
Download
2
Embed Size (px)
Citation preview
Oum SaokosalMaster of Engineering in Information System
Jeonju University, South KoreaO12-252-752
Mapping: Chen ERD to Table Relationship
Notation in Chen's E-R Diagram
EntityNote: An Entity in ER is an interested Entity.
Relationship
Weak Entity
Identifying Relationship
Student
Register
Football Player
Play on
Attribute Attribute
(XXX 1 – 1 dob) Multi-valued Attribute
(XXX 1 – M tel)
Composite Attribute (XXX M – 1 address)
(XXX 1 – 1 address)
Multi-valued Composite Attribute(XXX 1 – M Category)
Derived Attribute (XXX 1 – 1 age)
dob
tel
address
age
House
Street
categorycode
description
Mapping: 1-N
Seller make Purchase1 N
hire_dateid
name
tel other
id
date
name
Customer
tel
Note: in ER diagram, seller id is not included in the table Purchase. It is the foreign key referenced from the table Seller.However, in the table relationship, seller idhas to be included the table Purchase in order to make it 1-to-M relationship.
Mapping: 1-1
Student has Profile1 1
telid
name
sex address
father
photo
favoriteother
mother
Note:st_id: Autonumberpro_id: Number
Mapping: M-N
Student Register ClassM N
register datereg id
telid
name
sex address
id
name
yearsemester
capacity
Mapping: ISA Relationship
Student
telid
name
sex address
isa
Bachelor
Master
PhD
publication
research
thesis
dissertation
Note:In Student:st_id: Autonumber
In Bachelor, Master,PhD:st_id: Number
Mapping: M-N Tenary
Student Register ClassM N
register date
reg idtelidname
sexaddress
idname
yearsemester
capacity
Cashiername tel
T
Mapping: M-1 Unary (1)
Employee
telid
name
sex
address
Report to
M1
Cannot enter 4 intable em_report_tobecause no em_id = 4 yet.
Mapping: M-1 Unary (2)
SELECT S.em_id, S.em_name AS Boss, T.em_id, T.em_name AS StaffFROM tbl_employee AS S, tbl_employee AS TWHERE S.em_id = T.em_report_to;
Mapping: M-N Unary
Employee
telid
name
sex
address
Report to
MN
Oum SaokosalMaster of Engineering in Information Systems,
Jeonju University, South Korea012-252-752
End of Chapter