Structured Query Language Made Simple
Fukula Hastings NyekanyekaAggregate Functions I will discuss five important - SUM () gives the total of all the rows, satisfying any conditions, of the given column, where the given column is numeric.
- AVG () gives the average of the given column.
- MAX () gives the largest figure in the given column.
- MIN () gives the smallest figure in the given column.
- COUNT(*) gives the number of rows satisfying the conditions.
This query shows the total of all salaries in the table, and the average salary of all of the entries in the table.
This query gives the smallest figure of the Benefits column, of the employees who are Managers, which is 12500.
This query tells you how many employees have Staff status (3). |