Re: Database design: HELP!
Date: 1999/09/16
Message-ID: <37E09A2D.98770883_at_univ-savoie.fr>#1/1
bik2_at_mail.com wrote:
> Hi all database gurus out there!
>
> I have a problem: I've been assigned the task to design a database far
> a website that is going to be like Yahoo.
> They'll have categories, subcategories, subsubcategories and so on. On
> the leaf level are webpages of companies. Some of the subcategories may
> exist under several different higher-level categories, and companies
> can be under any level of categories and in several places.
> You have to also be able to search for a company or category name and
> be redirected there.
> Frankly I don't know how to approach the problem!
> Do I have to create 1 table for main categories, 1 for subcategories
> and so on and then one for companies? Or do I just create 1 table with
> all categories and then use the IDs to reference/run joins?
> Any other ideas? I use MSSQL 7.0. Please help, I'm running out of time
> and I'm a newbee at design of DBs! Answer this post or mail me!!!
> Thanks for reading!
> /Richard
Do you mean you want to modelize a Tree Structure ? Then , you just have to
make a single table called category :
Category
IdCategory | FatherCategory | CategoryName
If you have more than one father for a category, use a cross table :
Category
IdCategory | CategoryName
CategoryLink
IdFatherCategory | IdSonCategory
Pascal Received on Thu Sep 16 1999 - 00:00:00 CEST