Last answered:

16 Dec 2021

Posted on:

29 Nov 2021

0

why was GROUP BY function not used with ROUND(AVG(salary)) in solving the task???

i believe we have to use GROUP BY with AVG(salary), but why not to use it here??. any explanations

image.png

1 answers ( 0 marked as helpful)
Instructor
Posted on:

16 Dec 2021

1

Hi Asmaa!

The idea is that if you want to obtain the average salaries per manager, you should use the GROUP BY clause, if you want to obtain the average salary for all managers, then you should use only the AVG() aggregate function applied to the salary column like this – AVG(salary). The ROUND() function is used to round the salaries with 2 digits after the decimal point.

Hope this helps.
Best,
Tsvetelin

Submit an answer