Re: How to express a b-tree in SQL?

From: Philip Lijnzaad <lijnzaad_at_ebi.ac.uk>
Date: 2000/02/21
Message-ID: <u7aeku5qud.fsf_at_o2-3.ebi.ac.uk>#1/1


On Sun, 20 Feb 2000 16:49:02 -0800,
"George" == George hart <hart_at_rohan.sdsu.edu> writes:

George> Hi,
George> I was wondering if anybody has an opinons on the best way to express
George> a binary tree data structure in a relational table.   

mmm ... why are you doing this? The most important reason to store things in binary trees is to make searching easier, but this comes free with your database indexes.

An obvious answer was given by a different poster (The Big Cheese), but I suggest you look up the wise words of Joe Celko (either in on deja.com or from his very recommendable "SQL for Smarties" book), whose nested-set model allows you solve such designs within the table-as-a-set model.

                                                                      Philip
-- 
Not getting what you want is sometimes a wonderful stroke of luck.
-----------------------------------------------------------------------------
Philip Lijnzaad, lijnzaad_at_ebi.ac.uk | European Bioinformatics Institute,rm A2-24

+44 (0)1223 49 4639 | Wellcome Trust Genome Campus, Hinxton
+44 (0)1223 49 4468 (fax) | Cambridgeshire CB10 1SD, GREAT BRITAIN
PGP fingerprint: E1 03 BF 80 94 61 B6 FC 50 3D 1F 64 40 75 FB 53
Received on Mon Feb 21 2000 - 00:00:00 CET

Original text of this message