Re: Modelling hierarchy in the relational database

From: Mikito Harakiri <nospam_at_newsranger.com>
Date: Sat, 18 Aug 2001 00:23:56 GMT
Message-ID: <wAif7.5619$2u.54227_at_www.newsranger.com>


In article <3b7d87c0.509669_at_news.freeserve.net>, abracad says...
>
>I am constructing a database to model hierarchy, e.g.
> A
> |
 B
> |
> C
>
>I envisage a table parent consisiting fields parent, child and would
>store records A,B and B,C. Would I also need to store record A,C?
>
>I.e. can SQL act recursively to determina all the children of a given
>node (could it retrieve B and C if I queried for the children of A
>with only records A,B and B,C stored?)
>
>Many thanks in advance for any help on this

There are at least 2 methods:
1. Materialize tree paths. Try searching Google News on author=Brown as_q=tree. Here is a relevant thread, for example:
http://groups.google.com/groups?q=tree+group:comp.databases.theory+author:Brown&hl=en&safe=off&rnum=2&selm=7psan0%24ghq%241%40agate-ether.berkeley.edu 2. Joe Selko's ranges.

I would like to hear if anybody bothered comparing their strengths. Received on Sat Aug 18 2001 - 02:23:56 CEST

Original text of this message