-
Database Normalization
I have a invoice that I am trying to normalize to 3NF. I got it to 2NF but am stuck on 3NF because I am not sure what to do with the Order Number attribute.
UNF:
Invoice Number
Invoice Date
Order Number
Quantity
Products
Item Number
Unit Price
Tax
Total
Customer Name
Billing Address
Shipping Address
1NF:
Invoice Number(PK)
Invoice Date
Order Number
Quantity
Products
Item Number(PK)
Unit Price
Tax
Total
Customer Name
Customer ID
Billing Address
Shipping Address
2NF:
Invoice Number(PK)
Invoice Date
Customer Name
Customer ID
Billing Address
Shipping Address
Item Number(PK)
Quantity
Products
Unit Price
Tax
Order Number
Total
3NF:
Invoice
Invoice Number(PK)
Invoice Date
Customer ID(FK)
Customers
Customer ID(PK)
Customer Name
Billing Address
Shipping Address
Items
Item Number(PK)
Products
Unit Price
Tax
Order Line
Item Number(PK,FK)
Customer ID(PK,FK)
Order Number(PK)
Quantity
Total
-
You need to have Order table where you will have order number, customer id. FK to Orderline on order number.
Tax should not be on Items table as it may vary by state, it should be in Order table.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|