Re: What is Aggregation? Re: grouping in tuple relational calculus

From: Vadim Tropashko <vadimtro_invalid_at_yahoo.com>
Date: 18 Feb 2005 17:16:17 -0800
Message-ID: <1108775777.801768.322550_at_o13g2000cwo.googlegroups.com>


Mikito Harakiri wrote:
> All of them -- sets, bags, and lists -- have their place in RM. The
> importance is shifted heavily toward the left side: bags are only
important
> in the context of aggregation, and lists are even less important as
the
> "order by" SQL clause is virtually the only usage for them.
>
> Once again, if we loose accociativity, then we have to expand our
semantics
> spectrum to admit trees
>
> sets, bags, lists, trees
>
> This progression is natural:
> sets -- idempotent, commutative, associative
> bags -- nonidempotent, commutative, associative
> lists -- nonidempotent, noncommutative, associative
> trees -- nonidempotent, noncommutative, nonassociative

Here is a little bit different perspective.

A set is a bag that has its all element counted once only. A bag is a list that has its element ordered.

In other words, aggregation (with group by) maps a category of bags into sets. For example,

select figure from
{circle, circle, square, triangle}
group by figure

is a projection of a bag

{circle, circle, square, triangle}

into a set

{circle, square, triangle}

Likewise, ordering is a mapping of lists into bags. E.g.

select figure from
circle->square->circle->triangle
order by figure

would produce a bag

{circle, circle, square, triangle} Received on Sat Feb 19 2005 - 02:16:17 CET

Original text of this message