Re: OODB

From: Lauri Pietarinen <lauri.pietarinen_at_atbusiness.com>
Date: Fri, 29 Nov 2002 17:29:38 +0200
Message-ID: <3DE787E2.3060206_at_atbusiness.com>


Adrian,

what would be the correct result set in this case? If you can state it, then I (or somebody else) can state the correct (relationally clean) query.

regards,
Lauri Pietarinen

Adrian Veith wrote:

>"Scotty" <invallid_at_invalid.spam> schrieb im Newsbeitrag
>news:noaotu066nbjo304t5qbvrr74gfencntcv_at_4ax.com...
>
>
>>Do they exist or are they a figment of a college lecturers
>>imagination?
>>
>>
>
>They do exist!
>
>But, do REAL relational databases exist ?
>
>Problem:
>
>Consider the following families: Family Miller has kids John and Steve,
>Family Jones has kid Tom and Family Smith has no kids.
>
>So you can design these two relations:
>
>FAMILY (ID, NAME)
>1 Miller
>2 Jones
>3 Smith
>
>and KID(ID, NAME)
>1 John
>1 Steve
>2 Tom
>
>How do you get all the families with their kids ?
>
>Solution a) the natural join:
>
>select * from family f, kids k where f.id=k.id
>
>gives you the result:
>
>1 Miller 1 John
>1 Miller 1 Steve
>2 Jones 2 Tom
>
>how can we interpret the result:
>
>- Family Miller has 2 kids, because there are 2 rows with name Miller ?
>- Family Jones has 1 kid, because there is 1 rows with name Jones ?
>- Family Smith has no kids, because there is no row with name Smith ?
>
>so far so good. But then, the following statements may also be true:
>
>- Family Bush has no kids, because there is no row with name Bush ?
>- or family Bush does not exist ?
>- Family Smith is not a family, because they don't have kids ?
>
>Solution b) ok, ok try a non relational workaround - the outer join:
>select * from family f left outer join kids k on f.id=k.id
>
>1 Miller 1 John
>1 Miller 1 Steve
>2 Jones 2 Tom
>3 Smith <NULL> <NULL>
>
>At the first sight, the result looks slightly better:
>
>- Family Miller has 2 kids, because there are 2 rows with name Miller
>- Family Jones has 1 kid, because there is 1 rows with name Jones
>- Family Smith exists.
>
>but:
>
>- Has Family Smith 1 kid, because there is 1 row with name Smith ?
>- Is the statement 3 == <NULL> true or not ?
>- Is the result a true relation ?
>
>Solution c) ?
>
>--
>It looks like, that a "relational" database needs a non relational
>operation, which, in return, gives you a invalid relation !
>And as a result we have to live with these <NULL>s
>
>
>Problem:
>
>What is: "Relational Database" left outer join "Relational Algebra" ?
>
>a) Relational <NULL>
>b) <NULL> Database
>c) both a) and b)
>d) ?
>
>Welcome to the real world ;-)
>
>cheers,
>
>Adrian.
>
>
>
Received on Fri Nov 29 2002 - 16:29:38 CET

Original text of this message