Create the following statistical report for the HR departmen
Create the following statistical report for the HR department. Include the department name, the job title and the total salary for every job within a department for those departments whose department ID is greater than 80. Order by the department name and job ID use a join on this query. This is what i have so far but it is wrong,
select d.department_id, d.department_name, e.job_id, e.job_title, e.salary,sum(A.salary) FROM EMPLOYEES e JOIN departments d on (e.department_id = d.department_id) group by d.department_id where d.department_id > 80 order by department_name, job_id;
Solution
\"where\" clause should be there before group by clause
select d.department_name,e.job_title,sum(e.salary) as total_salary
from Employees e inner join departments d
on e.department_id = d.department_id
where d.department_id > 80
group by d.department_name,e.job_title
order by d.department_name,e.job_id;
