There are products, sections and attributes.
Each attribute can have up to 5 or 6 options.
Example: Power
10 Volt
15 Volt
20 Volt
And there are about 10 products in total, each product has up to 17 attributes applied to it.
Example: Product 1
power - 10 volt
color - red, yellow
link - online, offline
How would you setup the tables? Im stumped. I was thinking of having a separate table for each attrubute, then a products table and sections table.
The products table would house foreign keys for the attributes that relate to it and sections. Does this make sense?
This is quite common. You can have a base product table with some general attributes like…
Then you can extend the table for different product types. So you could have a table like
Or…
Then when needed you can join the extension tables to the core product table like this…
This way you can have a compact core product table used throughout your system. When you need to see the extra attributes you can easily join them to the core Product table.