F
Filibuster
What is the commom practice with regard to maintaining historical data (like
product price) in a database? For example, the Northwind database (Access
Tutorial) has a table for products (primary key = product ID). If I go into
products and change the price of a product, that new price is reflected in
all new orders that get entered using that product, but the new price is also
updated in any previous orders that were already placed (which is not good).
I can see a couple ways around this. 1) When a product attribute is
changed, a new product ID should be created, 2) Instead of using product ID
as a primary key - in case the product ID is some industry standard part
number, use a sequential index number as the primary key and maintain a
separate field for the standard product ID.
Perhaps there are other ways of dealing with this? Does anyone know of a
sample database that I can download that would use such a strategy? I'd like
to not only see the database structure, but understand how a database
application would deal with the problem in all areas (like reports, queries,
etc).
I hope I have explained the problem well enough. I am not sure what this
type of question really relates to, so I had difficulty searching the
discussions to see if other have asked the question... Thanks!
product price) in a database? For example, the Northwind database (Access
Tutorial) has a table for products (primary key = product ID). If I go into
products and change the price of a product, that new price is reflected in
all new orders that get entered using that product, but the new price is also
updated in any previous orders that were already placed (which is not good).
I can see a couple ways around this. 1) When a product attribute is
changed, a new product ID should be created, 2) Instead of using product ID
as a primary key - in case the product ID is some industry standard part
number, use a sequential index number as the primary key and maintain a
separate field for the standard product ID.
Perhaps there are other ways of dealing with this? Does anyone know of a
sample database that I can download that would use such a strategy? I'd like
to not only see the database structure, but understand how a database
application would deal with the problem in all areas (like reports, queries,
etc).
I hope I have explained the problem well enough. I am not sure what this
type of question really relates to, so I had difficulty searching the
discussions to see if other have asked the question... Thanks!