[thelist] Nested Queries

Steve Lewis slewis at macrovista.net
Wed Aug 21 14:14:01 CDT 2002


Sorry for that, hit send before I was done and munged the quoting anyway...

David.Cantrell at Gunter.AF.mil wrote:
> Unless you need a group to be a member of 0..n other groups, in which case
> you wind up with a many-to-many structure (and thus a joining table) and
> then it shouldn't matter if you go bottom-up or top-down.

As you probably know, that is refered to as multiple-inheritence in the
OO world.  If you have multiple-inheritence in your group hierarchy you
will probably also have a many-to-many relationship between groups in
which case you won't have a parent_id or child_id column, as such, in
the group table but instead use another table to manage that.  As you
said.

How do you deal with possible loops in the hierarchy however?  This
tends to enter into the realm of graph theory and the associated
algorithms which tend to be much more complex than tree algorithms.  I
would hope that Josh S is not working with a graph of groups! **shiver**

 > Speaking of which, anybody know where to find these database
patterns? > I couldn't find one for this with a search just now (google:
"database > design patterns").
you might try looking for something like "database tree schema" or such.
  This class of structures are called trees, and I have had better luck
using "database schema" when looking for this sort of information or
tools relating to a database design (such as AdeptSQL Workshop which I
hunted down on Monday).

-- Steve




More information about the thelist mailing list