Re: Tree (forest) design

From: Mikito Harakiri <mikharakiri_at_iahu.com>
Date: Fri, 5 Mar 2004 13:49:08 -0800
Message-ID: <xK62c.30$zW4.120_at_news.oracle.com>


"Neo" <neo55592_at_hotmail.com> wrote in message news:4b45d3ad.0403051247.6d449eb1_at_posting.google.com...
> Your solution won't work for Ex076. Ex076 allow a user to enter
> normalized and NULL-less data representing any hierarchy.

So does any other tree model in SQL.

> The
> hierarchy can consists of different type of things (ie church, person,
> dog, etc).

A "type" column can be easily added into hierarchy table if it makes you happy.

> Each thing in the hierarchy can have any number of parents.

Excuse me? Did you noticed anybody speaking about tree models that don't meet this assumption?

> For any such user created hierarchy, given the root, it generates a
> "Nearest Common Ancestor Report".
>
> If I enter the equivalent hierarchy in a typical db

Don't enter it into a "typical db" (whatever it might mean). Just create a hierarchy table and fill it with data. Is it something too diificult to comprehend?

> and specify the
> root, your (and Mikito's) code will not generate anything, among other
> reasons, neither handles a hierarchy where the parent and child are
> from different tables.

It might be possible that in some whaky schema design hierarchy spans multiple tables. One still can provide a view on top of it that represents the whole hierarchy as a single relation. Received on Fri Mar 05 2004 - 22:49:08 CET

Original text of this message