|< < 22 > >|

Aggregation

A simple query that cannot be expressed in Relational Algebra, or in the SQL we've seen so far:

How many rows are in table T?

Reviewing Relational Algebra operators:

  • select: Keep or reject a row.
  • project: Keep or reject a column.
  • product: Concatenate rows.
  • join: Match rows and possibly concatenate them.
  • divide: Keep or reject a row based on set comparison.
  • rename: Metadata operation.
  • union, intersect, difference: Keep or reject rows.

What about SQL functions?

  • Scalar operations so far: compute a value given column values in one row.

So far, we don't have a way to compute functions across multiple rows.

|< < 22 > >|