easycompany HR · Q2
self join

Earns more than their manager

Find every current employee who earns more than their direct manager.

Compare against the manager's salary even if the manager has since left the company. People without a manager can't earn more than one, so they never show up.

output columns
namesalarymanager_namemanager_salary

uses

ctrl + enter to run on the sample data · ctrl + shift + enter to submit

run your query to see the output here. Submit checks it against the sample data, hidden test cases, random data and a large dataset.