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

From: Vadim Tropashko <>
Date: 18 Feb 2005 17:16:17 -0800
Message-ID: <>

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
> in the context of aggregation, and lists are even less important as
> "order by" SQL clause is virtually the only usage for them.
> Once again, if we loose accociativity, then we have to expand our
> 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
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