Subject: A table setup question.
From: "al butler" <[EMAIL PROTECTED]>
 ===

 I have the MySQL book and I am trying to come to terms on how
to setup a column that is based on another one.

 Let me try and explain.

 Each row has a string (unique) and indexed.
 This string is catergorized by anothe column defined as a SET , let's call
it 1,2,3,4,5,6.
 From my readings this seems to be effiecient than having it classified as a
VARCHAR and is
also readable. It's treated as an int and can be indexed faster and more
effecient.

 But for item 6 in the SET, you can have up to 20+ categories.
 This sub-category I have defined as another SET and it's named something
like
 sub6. Now the SET can have other subcategories, so right now I would add
another column
 for each SET that needs a sub-category. Kind of ugly.

Let's recap:
col1 "string"         (VARCHAR)   64
col2 "category"     (SET) 1,2,3,4,5,6
col3 "subcategory of col2 6)    SET A,B,C,D,E,F,G,H

A set can have 64 items. I don't forsee col2 to ever reach this.
 I can forsee col3 possibly having 64 sub-categories of col2.

My question.
Is this the best I can do for a sub-category? Any suggestions?


Regards Al




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to