← All SQL interview questions
Employees earning more than their manager
MediumJoins — Self JoinOracleEXL
An HR compensation review flags reporting pairs where the direct report is paid more than the person they report to.
staff_roster stores the manager as a self-reference in manager_id. Return employee_name, employee_salary, manager_name and manager_salary for every employee whose salary is strictly greater than their manager's salary.
Sample data
More Joins — Self Join questions
- This is the only question on this topic for now.
Practising alone only goes so far — our live cohorts pair SQL depth with dashboards, agentic analytics projects and mock interviews.
Explore the program