I need help with normalization. I am having trouble understanding how to complete the 3NF on my database project. Here is the 1NF
Normalized Table
Donut ID(PK)
Donut Name
Description
Unit Price
Donut Order ID
Qty
CustomerID
Last Name
First Name
Last Name
Street Address
Apt
City
State
Zip
Home Phone
Mobile Phone
Other Phone
Order Date
Special Notes
2NF Donut Table
DonutID (PK)
Donut Name
Description
Unit Price
Sales Order Table
Sales OrderID (PK)
CustomerID
Last Name
First Name
Last Name
Street Address
Apt
City
State
Zip
Home Phone
Mobile Phone
Other Phone
Order Date
Special Notes
Sales Order Line Item Table
Sales Order (PK)(FK)
Dount ID (PK)(FK)
Qty
My problem is getting rid of the transitive dependencies in 3NF. What attribute would I use in my fourth table so nothing is redundant or depending on eachother without the primary key? Any direction would be greatly appreciated.
The Sales Order
table has a transitive dependency on the customer's name and address. If you look closely, you will see that each order will include the full address and name information for a given customer, even though that information probably isn't changing from one order to the next. To remedy this, you can move this information to a new Customer
table which would have these fields:
Customer Table
CustomerID (PK)
Last Name
First Name
Last Name
Street Address
Apt
City
State
Zip
Home Phone
Mobile Phone
Other Phone
The Sales Order
table would then become:
Sales Order Table
Sales OrderID (PK)
Order Date
CustomerID (FK)
Special Notes
Note that the order date can remain in the Sales Order
table because conceptually it represents a timestamp when each order occurred, unique to that particular order.
来源:https://stackoverflow.com/questions/39566058/normalization-transitive-dependencies