This is being tested with PostgreSQL 9.6 - it's a SQL challenge on the CodeWars website.
https://www.codewars.com/kata/580fb94e12b34dd1c40001f0/train/sql
SELECT
job_title,
CAST(SUM(salary)/COUNT(salary) AS DECIMAL(10,2)) AS average_salary,
COUNT(people_id) AS total_people,
CAST(SUM(salary) AS DECIMAL(10,2)) AS total_salary
FROM job
GROUP BY job_title
ORDER BY average_salary DESC;
average_salary 74.4506 --> should be 74.45
total_salary 372.253 --> should be 372.25