User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Database Design section within the Web Development category of DaniWeb, a massive community of 361,899 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,404 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Database Design advertiser:
Views: 3269 | Replies: 0
Reply
Join Date: Oct 2005
Posts: 1
Reputation: yazer is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
yazer yazer is offline Offline
Newbie Poster

A database with categories and subcategories

  #1  
Oct 12th, 2005
I did a table with categories in a products table then i figured our i should move the categories off into another table .. now I need to add subcategories ...
I read a bit .. and found someone doing this :
CATEGORY TABLE
-----------------------
CREATE TABLE CATEGORY(
cat_name char(50),
cat_id int4,
PRIMARY KEY(cat_id));
-----------------------

SUB_CATEGORY
---------------------------
CREATE TABLE SUB_CATEGORY(
subcat_name char(50),
subcat_id int4,
PRIMARY KEY(subcat_id));
---------------------------

SUB_SUB_CATEGORY
-------------------------------
CREATE TABLE SUB_SUB_CATEGORY(
sub_subcat_name char(50),
sub_subcat_id int4,
PRIMARY KEY(sub_subcat_id));
------------------------------

SUB_CATEGORY_LOOKUP_TABLE
----------------------------------
CREATE TABLE CATEGORY_LOOKUP_TABLE(
look_cat_id int4,
look_subcat_id int4,
look_sub_subcat_id int4,
PRIMARY KEY(look_cat_id,look_subcat_id,look_sub_subcat_id));

How can i use the lookup table? is this function supported by MySQL? It's empty although i added data to the categories and subcats...
please help
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Database Design Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Database Design Forum

All times are GMT -4. The time now is 8:46 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC