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

From: Erwin <e.smout_at_myonline.be>
Date: Sat, 9 Oct 2010 04:19:15 -0700 (PDT)
Message-ID: <746c7840-b5cb-4a16-98ff-aa66c3def471_at_j25g2000yqa.googlegroups.com>


On 8 okt, 21:36, Cimode <cim..._at_hotmail.com> wrote:
> 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.- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -

Allthough your intent is obviously right, it might be helpful to actually spell out the answer, instead of answering the question with a counterquestion ... Even if that counterquestion seems more than rhetorical enough _TO YOU_.

The OP asked the very same question on another forum too. I suppose he is trying to get "second opinion" or some such. Received on Sat Oct 09 2010 - 13:19:15 CEST

Original text of this message