SQL Series: Part 3— SQL Aggregate Functions with Sample
3 min readAug 24, 2024
Check Out Part 2 of the SQL Series:
What is Aggregate Function?
Definition: A set of functions used to perform calculations or summarize data across multiple rows in a table, and return a single value.
Common SQL Aggregations:
COUNT
: Counts the number of rows in a specified table or viewSUM
: Calculates the sum of all values in a specified columnAVG
: Calculates the average value of a specified columnMAX
: Returns the maximum value in a specified columnMIN
: Returns the minimum value in a specified column
To better understand and visualize how the aggregate functions works in the real world, the following employee table is created for illustration:
Employee Table
+-------------+-------------------+--------+
| employee_id | title | salary |
+-------------+-------------------+--------+
| 1001 | manager | 100000 |
| 1002 | data…