Beginner

384. AVG Function

Learn how to calculate the average of numeric values.

📘 Lesson 384 of 728 ⏱ 9 min 🎯 Beginner

AVG is an aggregate function that calculates the arithmetic mean of non-NULL numeric values.

Average values help analysts understand typical salaries, transaction amounts, sales values, scores, and other business measures.

Calculate the average employee salary.

SQL
SELECT
    AVG(Salary) AS AverageSalary
FROM Employees;

AVG is used for salary analysis, average order value, average transaction size, performance analysis, and KPI reporting.

  • AVG calculates an arithmetic mean.
  • NULL values are generally ignored.
  • It works with numeric values.
  • AVG can be used with GROUP BY.
  • The result may depend on the data type and database.
What does AVG calculate?

AVG calculates the arithmetic mean of non-NULL numeric values.

Does AVG include NULL values?

No. AVG normally ignores NULL values.

Have you finished this lesson?

Introduction to SQL – All Lessons