Re: OODB
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:
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