Create the following statistical report for the HR department. Include the depar
ID: 3773909 • Letter: C
Question
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;
Explanation / Answer
"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;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.