0 Replies - 1507 Views - Last Post: 03 February 2013 - 03:57 PM Rate Topic: -----

#1 Handler  Icon User is offline

  • D.I.C Head

Reputation: 15
  • View blog
  • Posts: 199
  • Joined: 01-April 10

Database design question

Posted 03 February 2013 - 03:57 PM

Ok, some background first, I trade goods, I buy 300 of item Y at 120 each. I then sell 200 of Y for 150 each. Now I have 100 of Y left. I then buy more of Y but this time at 130 each.

I need to also track who bought what, how much and the price they payed.

To recap: I'm buying the same items at different prices and quantities, I need to track how much of it I have, and I need to track the sales.

My Initial thought for table design was:
Stock
Stock
StockID,
item type,
item name,
bought price,
bought quantity,
selling price,
isSold, (This is just to mark it so I can leave it out of db queries)


Sales
SaleID,
Customer,
StockID(F-Key),
amount,
isDelivered,



Can someone give me some insight on this, I'm sure there is a way to improve it. If you need more information, please let me know :)/>

This post has been edited by Handler: 03 February 2013 - 04:08 PM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1