Re: Other tree representations in SQL
From: Alfredo Novoa <alfredo_at_ncs.es>
Date: 6 Dec 2002 04:23:34 -0800
Message-ID: <e4330f45.0212060423.26bd1317_at_posting.google.com>
Date: 6 Dec 2002 04:23:34 -0800
Message-ID: <e4330f45.0212060423.26bd1317_at_posting.google.com>
>> var Tree = real relation { N Char, P Char } key { N, P };
>> Tree := relation { tuple { 'A', 'A' }, tuple { 'B', 'A' }, tuple { 'C', 'A' },
>> tuple { 'D', 'B' }, tuple { 'E', 'B' }, tuple { 'F', 'C' },
>> tuple { 'G', 'C' } };
>How would you rename the data part of a Tree node, let's say
>if "A" had to become "Z"?
var Tree = real relation { N Char, P Char } key { N, P } foreign key { rename P as N } references Tree on update cascade;
update Tree where N = 'A' { N := 'Z' } ;
>Joe was looking for three different tree traversals and for
>two queries. Where are they in your example?
Alfredo Received on Fri Dec 06 2002 - 13:23:34 CET
