SQL • LESSON 09
COUNT, SUM, AVG
Learn how SQL aggregate functions summarize data across rows.
🟡 Intermediate⏱ 2 Minutes⭐ 170 XP
🤔 THE QUESTION
How can we calculate the total number of employees?
💡 WHAT IS IT?
COUNT() is an aggregate function that counts rows or non-null values in a result.
🎯 WHAT IS IT USED FOR?
It is useful for measuring record counts, monitoring data volume, creating reports, and answering questions such as 'How many records do we have?'
💻 EXAMPLE
SELECT COUNT(*) AS employee_count
FROM employees;Mission Brief
Practice using COUNT, SUM, and AVG to calculate useful statistics from employee data.
Objectives
- ✓ COUNT
- ✓ SUM
- ✓ AVG
- ✓ Aliases
- ✓ FROM