10.2 - Chapter 6 - Full Relations Operations
10.2 - Chapter 6 - Full Relations Operations
Chapter 6
Full relation operations
Objectives
1 Aggregation operators
2 Grouping
4 HAVING clauses
1 - Aggregate Functions
OR Aggregate Operators
STUDENT
CLASS_ID ID NAME
106 1A
106 2B
107 3C
107 4D
5E
6F
7G
8H
Syntax:
SELECT column, group_function (column)
FROM table
[WHERE conditions]
[GROUP BY group_by_expression]
[HAVING conditions]
[ORDER BY {column [ASC | DESC] ,…} ]
1
Select ROWS (with WHERE clause) first
2
ROWS are grouped (GROUP BY clause)
3
Groups matching the HAVING clause are
displayed
Example: HAVING