Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Ordering
Eliminating duplicate results
Aggregation
14. Find the average value
Grouping
HAVING: filtering and ordering groups
Let's practice

Instruction

OK, now that you know what the highest salary is, let's discuss another function:

SELECT AVG(total_sum)
FROM orders
WHERE customer_id = 100;

The function AVG() finds the average value of the specified column.

In our example, we'll get the average order value for the customer with id 100.

Exercise

Find the average salary in the table employees for the year 2013.

Stuck? Here's a hint!

Type:

SELECT AVG(salary)
FROM employees
WHERE year = 2013;