Skip to main content
SQL โ€ข LESSON 61

COUNT

How can we count the number of employees?

Intermediateโฑ 3 Minutesโญ 740 XP
๐Ÿค” THE QUESTION

How can we count the number of employees?

๐Ÿ’ก WHAT IS IT?

COUNT(*) computes the total number of rows matching the query criteria, including rows with NULL values.

๐ŸŽฏ WHAT IS IT USED FOR?

Record counting, volume estimation, data sanity checks, total employee rosters.

๐Ÿ’ป EXAMPLE
SELECT COUNT(*) AS employee_count
FROM employees;

๐ŸŽฏ Mission Objectives

Practice typing production-grade SQL code for COUNT.

  • โœ“ COUNT(*)
  • โœ“ Aggregate functions
  • โœ“ Total row count
  • โœ“ Aliasing results