Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Northwind traders unitprice redundancy?

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?

like image 927
Phil Avatar asked Jan 19 '26 09:01

Phil


1 Answers

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.

like image 77
Arjan Einbu Avatar answered Jan 22 '26 00:01

Arjan Einbu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!