Page 1 of 1

Best way to set up these tables...?

Posted: Sun Jul 21, 2002 11:22 pm
by Matt
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?

^_^

Posted: Mon Jul 22, 2002 1:09 am
by phice
id,type,bodytype,name,age

1,teen,athletic,anna,19
2,mature women,busty,jenny,95

4 tables, into 1. ;)

Posted: Mon Jul 22, 2002 2:10 am
by twigletmac
Good idea having the categories as foreign keys - less typing less chance of spelling mistakes - but you don't need a table full of them just add them into the item (women are items?) table:

Code: Select all

woman_id  name  age  cat1 cat2
---------------------------------
1         anna   19    1    1
Mac

Posted: Mon Jul 22, 2002 3:09 am
by phice
twigletmac wrote:(women are items?)
:oops:

Posted: Mon Jul 29, 2002 10:43 am
by Crashin
Me likes the sounds of the site YOU'RE developing! :D