Skip to main content
SQL • LESSON 09

COUNT, SUM, AVG

How do we compute summary statistics across an entire table?

Intermediate2 Minutes170 XP
🤔 THE QUESTION

How do we compute summary statistics across an entire table?

💡 WHAT IS IT?

Aggregate functions (COUNT, SUM, AVG, MIN, MAX) calculate summaries over sets of values.

🎯 WHAT IS IT USED FOR?

Executive KPIs, financial totals, average customer spend, and headcount reporting.

💻 EXAMPLE
SELECT
COUNT(*) AS employee_count,
SUM(salary) AS total_salary,
AVG(salary) AS average_salary
FROM employees;

🎯 Mission Objectives

Practice typing production-grade SQL code for COUNT, SUM, AVG.

  • COUNT()
  • SUM()
  • AVG()
  • Column Aliases (AS)