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

From: Cimode <cimode_at_hotmail.com>
Date: Sat, 9 Oct 2010 15:14:29 -0700 (PDT)
Message-ID: <72885253-9078-4a7d-a7e6-256ca1af6357_at_j25g2000yqa.googlegroups.com>


On 9 oct, 13:19, Erwin <e.sm..._at_myonline.be> wrote:
> 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.
In this case, the answer is much less interesting than the reasoning driving it. Getting an unintuitive point across to somebody who probably never read any significant RM theory material requires different language and lexicology than the formal one.

At best, it triggers further interest on the subject, at worst, it scares database practitioner wannabes who don't want to put some effort onto understanding things. The OP seems to belong to the former (I hope). Received on Sun Oct 10 2010 - 00:14:29 CEST

Original text of this message