Re: Creating a Hierarchical Structure
Date: Wed, 05 Sep 2001 16:43:43 +0200
Message-ID: <3B963A1F.7080007_at_netnord.dk>
KWillets wrote:
How would you query this schema?
>>How would you, or what is the commonly accepted way, of creating a database
>>which represents a hierarchical category structure ala Yahoo!?
>
> This works if every category has a single parent. However if a
> category can have more than one parent (as in most web directories),
> you need a more generalized representation. A typical implementation
> would be as follows:
>
> create table node( node_id int primary key,...)
> create table node_relationship( parent_node_id int references node,
> child_node_id int references node,
> primary key (parent_node_id, child_node_id))
>
> This structure can represent any directed graph structure, so some
> problems can arise if someone creates a loop.
> 4. We need an FAQ to get all these points straightened out.
That would be greate :)
-- Bo Gundersen DBA/Developer netnord A/S - http://www.netnord.dkReceived on Wed Sep 05 2001 - 16:43:43 CEST