Allan Smithee (bobalien) wrote in mysql,
Allan Smithee

storing sales data

i'm still working on the same catalog/shopping cart system i've posted about before (details irrelevant) and I'm trying to work out how I'm going to store records of the sales that go through the site - is it a better practice to store actual values in sales tracking table as opposed to id's -

for instance - say I have a table called tblSales - in tblSales, when a transaction goes through, I'm obviously going to want to store actual dollar values for the price of the item, the amount charged, the commissions paid out (instead of doing the math later when the past sales data is pulled up - in case prices are changed or items are removed, this way I've got a record of all actual dollars that changed hands)

but what about things like the name of the item, the name of the seller, the category of the item sold - is it worth it to store these actual strings in the sales tracking database as opposed to just the item 'id', and referencing the other data later? what i'm worried about is if id's for items or categories change in the future, or items are deleted, I don't want the previous sales records to get screwy.

thanks, and let me know if i didn't make any sense
  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.