views:

99

answers:

1

In the northwind traders database unitprice is listed on both the products and [order details] tables. Both tables list different prices for the same product. Is this a redundancy or is there an explanation for this?

+7  A: 

There's a reason.

When you change the price of a product, you don't want all orders containing that product changing as well. You need the unitprice in the [Order Details] table to preserve history.

Arjan Einbu
Correct. Think of it this way - the "UnitPrice" in the Order Details table is the unit price that the person actually paid - the price that was in effect at the time the order occurred. It's historical information.
GalacticCowboy
Didn't think of that. thanks.
Phil