2.1.27. Aggregates over sub-bags

  • Can run over subsets of tuples
  • GROUP BY keyword
  • Specifies the grouping attributes
  • Need to also appear in projected attr_list
  • Show result along side value for group attr
  • e.g. AggFunc over subgroups
    • SELECT dno, COUNT(*)
    • FROM employee
    • GROUP BY dno

Quick SQL check, do all attributes in the SELECT projection list appear in the GROUP BY projection list.