| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Does a Nested Sets tree require a single root node?
>> It seems to me that a nested sets tree must have a single root
node. Is this true? <<
Yes; that is the mathemtical definition of a tree and a root node; it would not matter how you modeled it.
>> I am converting an Adjacency List hierarchy to Nested Sets. In a
situation where I am organizing a list of manufacturers into a tree,
there is no single root manufacturer - so I would have to create an
"artificial" root node called "All Manufacturers", correct? <<
That would work, or you could go with a forest -- a table of trees
CREATE TABLE Forest
(tree_nbr INTEGER NOT NULL,
node CHAR(10) NOT NULL,
lft INTEGER NOT NULL,
rgt INTEGER NOT NULL,
CHECK (...),
PRIMARY KEY (tree_nbr, lft, rgt));
Received on Fri Aug 22 2003 - 16:17:52 CDT
![]() |
![]() |