Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have two table in my application, one is "item" and "itemprice" and these are already created by a previous developer. The itemprice table contain fields like, unitOfSale , itemPoint, itemSalePrice and itemPurchasePrice, tax. There are some fields those are duplicate in item and itmPrice table.

Can i merge itemPrice table in item table. will it do any negative imapact on architecture,

Do I need to keep the history of itemprice when it changes?

If I need to keep history of price then which architecture should i follow ? one table (merged table) or two table?


What I have tried:

I did not tried it any more as it specific condition
Posted
Updated 19-Mar-18 0:53am

1 solution

I'd suggest that there are two tables so that the price can change: if an item is bought on Monday at £10, and returned on Thursday after the price rose to £15, you want to refund the right amount of money.
There are two ways to handle that: one is to keep the price charged with the receipt / invoice item line data, and the other is to maintain a separate table entry for each change in item price.
From a quick look at your table, I'd say that the receipt / invoice data is your second table but you'd have to inspect the rest of the table and the code that manipulates it to be sure - we can't do that for you, we don't have any access to it. But if it is, then I'd strongly recommend you leave it as is!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900