Best way to set up these tables...?
Posted: Sun Jul 21, 2002 11:22 pm
Best table structure for a table that organizes items by category, subcategory1, subcategory2, subcategory3
I was thinking there would be the category name and id table, eg
cat_id,cat_name
1, teen
2, college girls
3, mature women
and a subcategory table, eg
sub_cat_id, sub_cat_name
1, busty
2, athletic
3, blonde
4, brunette
etc.
and then the item table
women_id, name, age
1,anna, 19
etc.
Since it's possible to have multiple subcategories, I would need a 4th table that would hold all the relationships.
cat_id, sub_cat_id, women_id
1,1,1
1,2,1
1,3,1
My concern is that this 4th table that everything hinges isn't based on a primary key and can get quite huge.
Is this the optimal way to solve this problem?
I was thinking there would be the category name and id table, eg
cat_id,cat_name
1, teen
2, college girls
3, mature women
and a subcategory table, eg
sub_cat_id, sub_cat_name
1, busty
2, athletic
3, blonde
4, brunette
etc.
and then the item table
women_id, name, age
1,anna, 19
etc.
Since it's possible to have multiple subcategories, I would need a 4th table that would hold all the relationships.
cat_id, sub_cat_id, women_id
1,1,1
1,2,1
1,3,1
My concern is that this 4th table that everything hinges isn't based on a primary key and can get quite huge.
Is this the optimal way to solve this problem?