Chapter 4 · Aggregations
29. Average Doctor Salary by Department
Easy10 XPHealthcare
Finance needs to compare average salaries across departments. For each department_id, calculate the average salary. Round to two decimal places and order by average salary descending.
Tables
- PKidINT
- first_nameTEXT
- last_nameTEXT
- specialtyTEXT
- FKdepartment_id→ departments.idINT
- emailTEXT
- phoneTEXT
- hire_dateTEXT
- salaryREAL
Need help?
Ask Sol
AI tutor — looks at your current query and nudges you, without spoiling the answer.
Solution
Try the hints first — solving it yourself is what makes it stick.