Hello,
I'm trying to set up a database for a website and need some help as I am starting to bang my head against the wall. Here is the situation:
There are 5 categories, each has between 5-10 subcategories
There are infinite amount of products.
Below are some of the options I have come up with. Which is the best and why? (Also Is there any difference between the first 2)
-------------------------------------
Categories
category_id (PK)
category
category_description
Subcategories
category_fk
subcategory_id (PK)
subcategory
subcategory_description
Products
category_fk
subcategory_fk
product_id (PK)
product_description
Categories
category_id (PK)
category
category_description
Subcategories
category_id(PK)
subcategory_id (PK)
subcategory
subcategory_description
Products
category_id(PK)
subcategory_id(PK)
product_id (PK)
product_description
Categories
category_id (PK)
category
category_description
Subcategories
subcategory_id (PK)
subcategory
subcategory_description
crosswalk table
category_subcategory_id (PK)
category_id
subcategory_id
Products
product_id (PK)
category_subcategory_id
product_description
Also I would like the option to place a product under multiple category/subcategory combinations, if it is not too complicated.
Categories
category_id (PK)
category
category_description
Subcategories
subcategory_id (PK)
subcategory
subcategory_description
crosswalk table
category_subcategory_id (PK)
category_id
subcategory_id
Products
product_id (PK)
product_description
product_category_subcategory
product_id (PK)
category_subcategory_id
category_subcategory_id2
category_subcategory_id3
Any help would be greatly appreciated. Thanks in advance!