SQL Aggregate
Functions
An aggregate function is a function that
performs a calculation on a set of
values, and returns a single value.
Aggregate functions are often used with
the GROUP BY clause of the SELECT
statement. The GROUP BY clause splits
the result-set into groups of values and
the aggregate function can be used to
return a single value for each group.
The most commonly used SQL aggregate functions
are:
•MIN() - returns the smallest value within the selected
column
•MAX() - returns the largest value within the selected
column
•COUNT() - returns the number of rows in a set
SUM() - returns the total sum of a numerical
column
AVG() - returns the average value of a
numerical column
Aggregate functions ignore null values
(except for COUNT()).
1. Create your own database. – 2pts
2. Ten rows and 5 column. – 3 pts
3. Returns the largest value within the
selected column – 1pt
4. Returns the smallest value within the
selected column. 1pt
5. Returns the number of rows in a set. 1pt
6. Returns the total sum of a numerical
column. - 1pt
7. Returns the average value of a numerical
column- 1pt