84
General form of Grouping and
Aggregation
•
SELECT
S
•
FROM
R
1
,…,R
n
•
WHERE
C1
•
GROUP BY
a
1
,…,a
k
•
HAVING
C2
•
•
S = may contain attributes a
1
,…,a
k
and/or any aggregates but NO OTHER
ATTRIBUTES
•
C1 = is any condition on the attributes in R
1
,…,R
n
•
C2 = is any condition on aggregate expressions
Why ?