📖
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?