HR wants to identify high earners relative to their peers. Find doctors whose salary is above the average salary of their department. Return doctor full name, department_id, salary, and the department average salary (rounded to 2 decimals) as dept_avg_salary. Order by salary descending.
Schema
🔑idINT
first_nameTEXT
last_nameTEXT
specialtyTEXT
🔗department_idINT
emailTEXT
phoneTEXT
hire_dateTEXT
salaryREAL
postgresql
Run your query to see results
Press Ctrl + Enter to execute