You are on page 1of 3

1. Using the INVOICE table structure shown in Table P5.

1, write the relational schema, draw its


dependency diagram and identify all dependencies (including all partial and transitive dependencies).
You can assume that the table does not contain repeating groups and that any invoice number may
reference more than one product. (Hint: This table uses a composite primary key.)

Table P5.1 Sample INVOICE Records


Attribute Name
INV_NUM
PROD_NUM
SALE_DATE
PROD_LABEL

Sample Value
211347
AA-E3422QW
15-Jan-2006
Rotary sander

VEND_CODE
VEND_NAME
QUANT_SOLD
PROD_PRICE

211
NeverFail, Inc.
1
$49.95

Sample Value
211347
QD-300932X
15-Jan-2006
0.25-in. drill
bit
211
NeverFail, Inc.
8
$3.45

Sample Value
211347
RU-995748G
15-Jan-2006
Band saw

Sample Value
211348
AA-E3422QW
15-Jan-2006
Rotary sander

Sample Value
211349
GH-778345P
16-Jan-2006
Power drill

309
BeGood, Inc.
1
$39.99

211
NeverFail, Inc.
2
$49.95

157
ToughGo, Inc.
1
$87.75

2. Using the initial dependency diagram drawn in Problem 1, remove all partial dependencies, draw the
new dependency diagrams, and identify the normal forms for each table structure you created.

NOTE
You can assume that any given product is supplied by a single vendor but a vendor can
supply many products. Therefore, it is proper to conclude that the following dependency
exists:
PROD_NUM PROD_DESCRIPTION, PROD_PRICE, VEND_CODE, VEND_NAME
(Hint: Your actions should produce three dependency diagrams.)

Figure P5.1&2 The Dependency Diagrams for Problems 1 and 2


Problem 1 Solution

INV_NUM PROD_NUM SALE_DATE PROD_DESCRIPTION VEND_CODE VEND_NAME NUM_SOLD PROD_PRICE

Partial dependency

Transitive Dependency
Partial dependencies

Relational schema: 1NF(INV_NUM, PROD_NUM, SALE_DATE, PROD_DESCRIPTION, VEND_CODE,


VEND_NAME, NUM_SOLD, PROD_PRICE)

Problem 2 Solution
INV_NUM PROD_NUM

NUM_SOLD

3NF

3NF

Relational schema: 3NF(INV_NUM, PROD_NUM, NUM_SOLD)

INV_NUM SALE_DATE

Relational schema: 3NF(INV_NUM, SALE_DATE)

PROD_NUM PROD_DESCRIPTION PROD_PRICE VEND_CODE

VEND_NAME

2NF (Contains a
transitive dependency)

Transitive Dependency
Relational schema: 2NF(PROD_NUM, PROD_DESCRIPTION, VEND_CODE, VEND_NAME)

Using the results of Problem 3, draw the Crows Foot ERD.

Figure P5.4 The Invoicing ERD and Its (Partial) Relational Diagram

Crows Foot Invoicing ERD

Invoicing Relational Diagram, Sample Attributes


INVOICE
INV_NUM
INV_DATE

LINE
INV_NUM
PROD_NUM
NUM_SOLD

PRODUCT
M

PROD_NUM
PROD_DESCRIPTION
PROD_PRICE
VEND_CODE

VENDOR
VEND_CODE
VEND_NAME

You might also like