View Single Post
  #11 (permalink)  
Old 03-11-10, 04:39
dportas dportas is offline
Registered User
 
Join Date: Dec 2007
Location: London, UK
Posts: 732
Quote:
Originally Posted by tanthiamhuat View Post
I understand your suggestion of putting all those tables (breads, fruits, drinks, milks, etc) into a single table called products. Do I need to create another table called machines, with MachineID as the Primary Key? How do I then associate the machines table and products table?

For example, I would need to query what is the total revenue from all breads from MachineID=101. How could I do that, if it is a single table called products?
I'm not clear if revenue is supposed to be a property of a product alone or of a particular combination of product and machine. If a product belongs to more than one machine then would you want just one revenue figure for that product or one figure for each machine?

I'm not going to do your homework for you but I assume you must have some table that associates machines to products and that that table may or may not be the one with the revenue figure in it - depending on how you answer the above question.
Reply With Quote