Re: beginners querying question

From: Jan Hidders <hidders_at_REMOVE.THIS.win.tue.nl>
Date: 27 Aug 2001 18:12:50 GMT
Message-ID: <9me2j2$n75$1_at_news.tue.nl>


Niko Schwarz wrote:
> Hi folks,
>
> I'm just trying to understand bout RDB and i seem to have a serious problem
> bout one task in my book...
> ive got a table with several pricings of articles and an article number.
>
> now find the pricing of the cheapest article seems pretty simple:
>
> grp[|min ::= MIN(pricing)](Articles)
>
> but how to get the number?
>
> i found this one:
>
> grp[|pricing ::= MIN(pricing)](Articles) join[pricing](Articles)
>
> is this possible? or reasonable? isnt there another... you know, a cuter
> way to do that? if this would work, it would seem to me like the dirtiest
> hack on world =)

Unfortunately there is not a standard way of extending the relational algebra with aggregation / grouping operations, so it depends on what book you are using and how they define the operations.

But in most extensions I've seen your solution is possible, and I would also say that it is reasonable. Keep in mind that the join is an abstract operation that is not necessarily implemented with a nested loop. So the expression does not imply that you are iterating over the same table twice. I assume that is why you feel it is a "hack".

-- 
  Jan Hidders
Received on Mon Aug 27 2001 - 20:12:50 CEST

Original text of this message