Part 51: Aggregate Functions: COUNT, SUM, AVG, MIN & MAX
Aggregate functions calculate a single summary result from multiple rows.
1. Core Functions
SELECT
COUNT(*) AS total_employees,
SUM(salary) AS total_payroll,
AVG(salary) AS average_salary,
MIN(salary) AS lowest_salary,
MAX(salary) AS highest_salary
FROM employees;
Key Takeaways
- Aggregate functions ignore
NULLvalues (except forCOUNT(*)).
In Part 52, we explore Understanding COUNT(*) vs COUNT(column) vs COUNT(DISTINCT)!

