Path: news.cambrium.nl!textnews.cambrium.nl!feeder3.cambriumusenet.nl!feed.tweaknews.nl!postnews.google.com!m1g2000vbh.googlegroups.com!not-for-mail
From: Erwin <e.smout@myonline.be>
Newsgroups: comp.databases.theory
Subject: Re: The Relational Model & Queries That Naturally Return Duplicate Rows
Date: Sun, 10 Oct 2010 02:35:44 -0700 (PDT)
Organization: http://groups.google.com
Lines: 48
Message-ID: <cc6c5463-7e32-472b-a68f-1f70c26875b9@m1g2000vbh.googlegroups.com>
References: <0d9300b0-88be-40f3-ae94-97d1beac56dd@j18g2000yqd.googlegroups.com>
 <03efca15-4020-4ea2-b0c3-cfb8723e713f@l20g2000yqm.googlegroups.com>
 <746c7840-b5cb-4a16-98ff-aa66c3def471@j25g2000yqa.googlegroups.com>
 <72885253-9078-4a7d-a7e6-256ca1af6357@j25g2000yqa.googlegroups.com>
 <19f86d37-9d8c-40a4-b9f5-60bdb706b81b@t3g2000vbb.googlegroups.com> <op.vkcafzznq7k8pw@the-thurbonss-imac.local>
NNTP-Posting-Host: 77.109.100.36
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1286703344 29552 127.0.0.1 (10 Oct 2010 09:35:44 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sun, 10 Oct 2010 09:35:44 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: m1g2000vbh.googlegroups.com; posting-host=77.109.100.36; posting-account=-nQufgoAAABsreOCZNqo2Uyh8O-fYVPT
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727),gzip(gfe)
Xref:  news.cambrium.nl

On 10 okt, 04:56, "Joe Thurbon" <use...@thurbon.com> wrote:
>
> In the context of recent discussion on the ttm mailing list regarding =A0
> ORDER BY, it's not clear to me that correct answer is indeed obvious. (In=
 =A0
> fact, given my track record on cdt, I'm not sure that I am thinking of th=
e =A0
> correct answer).
>
> With that caveat in mind, given that, with the OP's database, the query
>
> SELECT FIRST_NAME from USERS order by FIRST_NAME
>
> presents the user with something that is not a relation, it seems strange=
 =A0
> to require that
>
> SELECT LAST_NAME from USERS
>
> should. (Apart from that projection is a relational operator, and order b=
y =A0
> isn't, but that seems to me at least to be slightly subtle).
>
> Cheers,
> Joe-
>
> - Tekst uit oorspronkelijk bericht weergeven -

"slightly subtle" ??????

You mean as in "that difference could equally well not exist at
all" ?????

In functional style, "SELECT FIRST_NAME from USERS order by
FIRST_NAME" is something like ORDER_BY(SELECT(USERS,{FIRST_NAME})),
and "SELECT FIRST_NAME from USERS" is just SELECT(USERS,
{FIRST_NAME}).  From that, it should be indisputably clear that the
type of both expressions are different.

The former returns something which conveys order, and thus cannot be a
relation, whereas the latter, insofar as we understand SELECT to mean
"relational projection", returns a relation, which does not convey
order, and cannot possibly contain duplicate tuples.

If one wants SELECT to mean something different than relational
projection, then I refer to "Logic and Databases", chapter 12.  There,
"bag algebra" is investigated (and its inferiority to relational
algebra exposed).
