I'm trying to cast average_salary and total_salary as float 2 decimal places but I keep getting an error. Am I doing this correctly?
Error: Test Failedexpected 2 to be a kind of Float
SELECT
j.job_title,
SUM(j.salary)/COUNT(p.id)::float, 2 AS average_salary,
COUNT(p.id) AS total_people,
SUM(j.salary):: float, 2 AS total_salary
FROM job j
JOIN people p
ON p.id = j.people_id
GROUP BY j.job_title
ORDER BY total_salary DESC
LIMIT 100