Table Question
Posted by: Nikos - Vasilis Merianos
Date: February 26, 2008 02:25AM

Hello all . . .

I have a general question on about how to design a table.

The problem is :

I like to create my own web directory.

The directory must have general categories such as Vecation, Medical, etc.

Each of the general categories must have it's own sub categories and each sub category must have it's own sub category and so on for n levels of sub categories.

Normaly if i knew from now how many sub categories i need then i had to create this amount of tables for each sub category.

The question is :

if i create this table for example

|___________________________________________________|
|_cat_id___|_cat_name_______________|_parent_id_____|
|___________________________________________________|
|____1_____|_Vecation_______________|______0________|
|____2_____|_Medical________________|______0________|
|____3_____|_Cars & Bikes___________|______0________|
|____4_____|_Factories______________|______0________|
|____5_____|_Hotels_________________|______1________|
|____6_____|_Maps___________________|______1________|
|____7_____|_Organizations__________|______1________|
|____8_____|_Agents_________________|______1________|
|____9_____|_Hotel ABC______________|______5________|
|____10____|_Hotel DEF______________|______5________|
|____11____|_Cars___________________|______2________|
|____12____|_Bikes__________________|______2________|
|____13____|_BMW____________________|______11_______|
|___________________________________________________|

The cat_id is the category ID
The cat_name is the category name
and the Parent ID is the category id of the parent category.


Is that correct or not ? ? ?

http://www.web-resources.eu

Options: ReplyQuote


Subject
Written By
Posted
Table Question
February 26, 2008 02:25AM
February 26, 2008 12:16PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.