How do we compute summary statistics across an entire table?
Aggregate functions (COUNT, SUM, AVG, MIN, MAX) calculate summaries over sets of values.
Executive KPIs, financial totals, average customer spend, and headcount reporting.
SELECT
COUNT(*) AS employee_count,
SUM(salary) AS total_salary,
AVG(salary) AS average_salary
FROM employees;Practice typing production-grade SQL code for COUNT, SUM, AVG.