Chapter 6 · Subqueries
34. Doctors Earning Above Average
Medium20 XPHealthcare
Find all doctors whose salary is above the overall average salary. Return their first name, last name, specialty, and salary, ordered by 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.