Skip to main content
SQL • LESSON 67

Multiple Aggregates

How can we calculate several statistics in one query?

Intermediate3 Minutes800 XP
🤔 THE QUESTION

How can we calculate several statistics in one query?

💡 WHAT IS IT?

Multiple aggregate functions can be executed simultaneously in a single SELECT statement to generate comprehensive summary reports.

🎯 WHAT IS IT USED FOR?

Summary cards, KPI dashboards, statistical overviews in single-pass query scans.

💻 EXAMPLE
SELECT
COUNT(*) AS employee_count,
MIN(salary) AS minimum_salary,
MAX(salary) AS maximum_salary,
AVG(salary) AS average_salary
FROM employees;

🎯 Mission Objectives

Practice typing production-grade SQL code for Multiple Aggregates.

  • Multi-aggregation
  • Summary KPIs
  • Single-scan metrics
  • Statistical rollups