Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Function AVG
24. ROUND and AVG
Functions SUM, MAX, MIN
Review

Instruction

Okay. Finally, we can use ROUND with AVG to get a nicer appearance for our results:

SELECT
  ROUND(AVG(price), 2)
FROM project;

The above query will round the average price to two decimal places. Of course, you can also use AVG without the second argument: ROUND(AVG(price)) to get rounding to integer values.

Exercise

For each client in the project table, show the client ID and find the average price for all their projects rounded to integer values. Column names should be client_id and rounded_average.

Stuck? Here's a hint!

Use ROUND(AVG(price)) and group by the client_id.