0% found this document useful (0 votes)
11 views

W3C2 Assignment 2

Uploaded by

ibrahimnaseef19
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

W3C2 Assignment 2

Uploaded by

ibrahimnaseef19
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

u ASSIGNMENT 2: THE QUEEN ANNE CURIOSITY SHOP

PROJECT QUESTIONS (Chapter Two)


Submission: A single PDF file to Dropbox on ANGEL. (In Word, go to File à Save as à
Format: PDF à Save)
Note:
• Spelling check in Microsoft Word may block people seeing underline for primary key.
Please turn off the spelling check in Word or view the PDF version of this assignment
from wiki.
• In this assignment, you do not need to split tables. To answer Question B.4, D.4 and E,
you just need to use relation representation (use underline and italic to denote primary
key and foreign key).

Assume we have following SALE table and PURCHASE tables.

Table 1 SALE Table

Table 2 PURCHASE Table


A. Comment on following designs (whether the primary keys are appropriate). (10 points)

Hint: The answer may not be simple yes or no.

1. SALE (CustomerName, CustomerPhone, CustomerAddress, ItemName, SalePrice,


SaleDate)

2. SALE (CustomerName, CustomerPhone, CustomerAddress, ItemName, SalePrice,


SaleDate)

3. SALE (CustomerName, CustomerPhone, CustomerAddress, ItemName, SalePrice,


SaleDate)

4. SALE (CustomerName, CustomerPhone, CustomerAddress, ItemName, SalePrice,


SaleDate)

B. Add ID columns called CustomerID and SaleID into the SALE table. Answer following
questions. (40 points)

1. List one candidate key in this relation.

2. List at least two functional dependencies. What is the determinant in each functional
dependency?

3. Is the SALE relation well-formed? Why?

4. If the relation is not well-formed, normalize it to a well-formed relation. In the well-


formed relation, please indicate the primary key and foreign key.

C. Comment on following designs (whether the primary keys are appropriate). (10 points)

Hint: The answer may not be simple yes or no.

1. Purchase (ItemName, PurchasePrice, PurchaseDate, VendorName, VendorPhone,


VendorAddress)

2. Purchase (ItemName, PurchasePrice, PurchaseDate, VendorName, VendorPhone,


VendorAddress)

3. Purchase (ItemName, PurchasePrice, PurchaseDate, VendorName, VendorPhone,


VendorAddress)

4. Purchase (ItemName, PurchasePrice, PurchaseDate, VendorName, VendorPhone,


VendorAddress)

D. Add ID columns called VendorID and PurchaseID into the PURCHASE table. Answer following
questions. (40 points)

1. List one candidate key in this relation.

2. List at least two functional dependencies. What is the determinant in each functional
dependency?
3. Is the PURCHASE relation well-formed? Why?

4. If the relation is not well-formed, normalize it to a well-formed relation. In the well-


formed relation, please indicate the primary key and foreign key.

E. You may realize that items in SALE and PURCHASE tables are not connected. For example, for
the lamp sold to customer Anderson, we did not keep the information of where this lamp was
purchased. Add an additional ITEM table to remedy this problem. How would you design ITEM
table and how would you modify the tables you designed in Question B.4 and D.4 accordingly?
Discuss how you keep track of the items in both SALE and PURCHASE in this design. (Bonus: 5
points)

You might also like