Re: OODB

From: Lauri Pietarinen <lauri.pietarinen_at_atbusiness.com>
Date: Fri, 29 Nov 2002 23:25:50 +0200
Message-ID: <3DE7DB5E.2060605_at_atbusiness.com>


>
>
>What he wants is a nested relation that contains a record for each family
>with a nested relation that contains all the kids with each family. I'll
>leave it to you to explain to him that indeed that is possible in REAL
>relational databases and, yes, these actually exist. ;-)
>

Good point, Jan

and, in fact, in Date's "Introduction to DB Systems" (7ed) on page 599 there is a discussion of outer join and one of the suggested intrepretations would echo what you said (one row for each family and the "kids" column with a nested relation).

As for a "clean" SQL-solution without outer joins, you can always write an outer join
as a union (albeit it does become a bit cumbersom as the amount of tables increases) like this:

select *
  from family f, kids k
   where f.id = k.id
union
select *, 0, ' '
  from family f
  where not exists
    (select * from kids k

         where f.id = k.id);

As for the real real relational databases hinted to by Jan, you could say that Dataphor comes close, albeit it does not have the nested relation fuctionality (yet) as described above.

However, there are other nice properties. I could refer you to an earlier posting of mine. I would challenge you to write the equivalent query using an OO-language or even SQL and a programming language.

Here is the link:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&frame=right&rnum=151&thl=1008160018,1007073116,1004704616,998397257,1010068187,1014937140,1011481432,1011286639,1011137577,1010965339,1010902245,1010843004&seekm=e9d83568.0210301138.2e5099e6%40posting.google.com#link153

Please note that the examples are "live", i.e. they have actually been executed on a live system.

regards,
Lauri Pietarinen

regards,
Lauri Pietarinen Received on Fri Nov 29 2002 - 22:25:50 CET

Original text of this message