How to create a better tables Structure.

Posted by user160820 on Stack Overflow See other posts from Stack Overflow or by user160820
Published on 2010-12-28T08:49:03Z Indexed on 2010/12/28 8:54 UTC
Read the original article Hit count: 169

Filed under:
|
|
|

For my website i have tables

Category :: id | name
Product  :: id | name | categoryid

Now each category may have different sizes, for that I have also created a table

Size :: id | name | categoryid | price

Now the problem is that each category has also different ingredients that customer can choose to add to his purchased product. And these ingredients have different prices for different sizes. For that I also have a table like

Ingredient :: id | name | sizeid | categoryid | price

I am not sure if this Structure really normalized is. Can someone please help me to optimize this structure and which indexed do i need for this Structure?

© Stack Overflow or respective owner

Related posts about sql

Related posts about mysql