The typical way of defining this is:
CREATE TABLE Category
(
CategoryID Integer Identity Primary Key,
Description VarChar(255),
ParentCategoryID Integer References Category,
)
You will probably want to add an index on ParentCategoryID
Then you can expand it with something like:
SELECT
A.Description AS ADescription,
B.Description AS BDescription,
C.Description AS CDescription .....
FROM Category A, Catagory B, Category C .....
WHERE
C.ParentCategoryID = B.CategoryID
AND B.ParentCategoryID = A.CategoryID
This will provide a good combination of flexibility (good db design) and
performance.
If the the data are static, the number of rows small, and performance
is critical then you might consider denormalization to gain
additional performance.
HTH
Dick
At 4:42 PM -0700 6/20/2000, Brook Davies wrote:
>I have listings that look like:
>
>1.0 foobars
> 1.1 foobars the revenge
> 1.1.2 foobars the revenge II
> 1.1.2.1 more foobar specials
>2.0 brown foobars
>3.0 green foobars
>
>etc..
>
>What is the best DB design in terms of performance for a classification
>system like this?
>
>Thanks,
>Brook Davies
>MaracasMedia Inc.
>
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.