Tải bản đầy đủ (.doc) (4 trang)

bài tập trắc nghiệm cơ sở dữ liệu chương 15 methodology – logical database design for relational model (er – relation mapping) tutorial

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (75.13 KB, 4 trang )

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
relations.
Employee
empNo {PK}
name
address
Project
projectNo {PK}
pName
description
WorksOn
1 * 1 *
Employee
empNo {PK}
name
address
Holds
1 1 1 1
Employment
Contract
contractNo {PK}
position
date
salary
Vehicle
regNo {PK}
make


model
Check
date {PPK}
faults
Has
1 1 0 *
hours
Supervises
Employee
empNo {PK}
name
address
sDate
0 *
0 1
2. 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
1 1
1 *
Department
dNo {PK}
dName
dLoc
Employs
1 1
Employee
empNo {PK}
name
fName
lName
address
Has
0 *
1 1
Employment
History
compOrganName
(PPK}
address
position
sDate
fDate
1 *

(b)
OrderDetails
qty
status
/totalPrice
Requires
1 *
1 1
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
1 *
1 1
Order
ordeNo (PK}
status
dateDue
/totalPrice
1 1
3. 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
1 * 1 1 Department
name {PK}
number
locations [1…5]
/noOfEmployees
startDate
Manages
1 1 0 1
Supervises
0 1
0 *
WorksOn
0 *
1 *
Controls
0 *
1 1
hours

×