Chapter 15 Methodology – Logical database design for relational model ER – Relation Mapping Tutorial 1.. Represent the entity and relationship types shown in the ER diagrams below as r
Trang 1Chapter 15 Methodology – Logical database
design for relational model (ER – Relation Mapping)
Tutorial
1 Represent the entity and relationship types shown in the ER diagrams below as
relations.
Employee
empNo {PK}
name address
Project projectNo {PK}
pName description
WorksOn
Employee
empNo {PK}
name address
Holds
Employment Contract contractNo {PK}
position date salary
Vehicle
regNo {PK}
make model
Check date {PPK}
faults
Has
hours
Supervises
Employee
empNo {PK}
name address
sDate 0 *
0 1
Trang 22 The ER diagrams shown below are taken from the example answers for Question 2
and 5 of the Chapter 11 Entity-Relationship Modeling Tutorial However, for the purposes of this tutorial, the attributes associated with entity or relationship types are also included in the diagrams Present a relational schema for each of the ER diagrams shown below
(a)
Dependent
dName {PPK}
dAddress relationship
RelatedTo
0 *
1 1
Company
cName {PK}
cAddress cTelNo cFaxNo
Operates
Department dNo {PK}
dName dLoc
Employs 1 1
Employee
empNo {PK}
name fName lName address
Has
Employment History compOrganName (PPK}
address position sDate fDate
1 *
Trang 3(b)
OrderDetails
qty status /totalPrice
Requires
Product prodNo {PK} desc price cost numberAllocation reorderQty reorderLevel inStock PartOf
1 *
Customer
custNo {PK} name fName lName address street city postcode telNo creditLimit
Places
Order ordeNo (PK}
status dateDue /totalPrice 1 1
Trang 43 Present a relational schema for the ER diagram shown below
Dependent
dName {PPK}
relationship sex birthDate
Project number {PK} name {AK} location
RelatedTo
0 *
1 1
Employee
SSN {PK}
name fName mI lName address sex salary bDate
WorksFor
name {PK}
number locations [1…5] /noOfEmployees
startDate
Manages
Supervises
0 1
0 *
WorksOn
0 *
0 * 1 1
hours