Re: The Relational Model & Queries That Naturally Return Duplicate Rows

From: Cimode <cimode_at_hotmail.com>
Date: Fri, 8 Oct 2010 12:36:44 -0700 (PDT)
Message-ID: <03efca15-4020-4ea2-b0c3-cfb8723e713f_at_l20g2000yqm.googlegroups.com>


On 8 oct, 15:44, Seun Osewa <seun.os..._at_gmail.com> wrote:
> Hi,
>
> It's commonly understood that in the relational model:
>
>    1. Every relational operation should yield a relation.
>    2. Relations, being sets, cannot contain duplicate rows.
>
> Imagine a 'USERS' relation that contains the following data.
>
> ID FIRST_NAME LAST_NAME
>  1 Mark       Stone
>  2 Jane       Stone
>  3 Michael    Stone
>
> If someone runs the query "select LAST_NAME from USERS", a typical
> database will return:
>
> LAST_NAME
> Stone
> Stone
> Stone
>
> Since this is not a relation - because it contains duplicate rows -
> what should an ideal RDBMS return?
>
> Regards.
Rephrase your query in plain word english and you will find the answer is obvious.

Suppose that appart from you, there are two members of your family, bearing the same name than you working in your company. Suppose you ask your best friend, that talks to you on a daily basis, visiting *Give me the LAST NAMES of ALL EMPLOYEES of my company* ? What will you think if that friend repeats three time the same thing. Received on Fri Oct 08 2010 - 21:36:44 CEST

Original text of this message