Home›Learn›SQL›COUNT, SUM and AVG
SQL Master CourseBeginner Friendly

COUNT, SUM and AVG

Learn three common aggregate functions used for calculations.

📘 Chapter 23 / 51⏱️ 8–10 Min Read🎯 Beginner Friendly
Course Progress45%

Course Progress

45%

23 / 51 chapters

📖

Theory

Understand the concept step by step

COUNT counts rows or values. SUM calculates the total of numeric values. AVG calculates the average of numeric values. These functions are commonly used for data analysis.
💻

Example

See how the concept works in SQL

SQL
SELECT
  COUNT(*) AS total_users,
  SUM(salary) AS total_salary,
  AVG(salary) AS average_salary
FROM employees;
📤

Output

Understand what the query produces

The query returns the number of employees, total salary and average salary.

📝

Practice

Test your understanding

Calculate the total and average price of products.

❓

MCQs

Check your SQL knowledge

What is the main concept covered in COUNT, SUM and AVG?

A.Aggregate calculations
B.Table creation
C.Row deletion
D.Index creation
💼

Interview Questions

Prepare for SQL interviews

1

Interview Question

What does COUNT do?

2

Interview Question

What does SUM do?

3

Interview Question

What does AVG do?