EASYVerified Real Interview• Data Analyst / People Analytics
Employees Earning More Than Their Manager
Verified Source:Public Interview Repository
Meta's Compensation & People Analytics team is evaluating managerial equity balance.
Write a SQL query to find all employees who earn strictly more than their direct manager.
Return the employee's name (employee_name), their salary (employee_salary), their manager's name (manager_name), and their manager's salary (manager_salary).
Sort by employee salary descending.
Tables:
employees(emp_idINT,nameVARCHAR,salaryINT,manager_idINT)
Execution Sandbox:
Your query executes inside an isolated in-memory PostgreSQL engine (PGlite WebAssembly). You have full access to standard PostgreSQL aggregations, window functions, and CTEs.
Standard SQL (ANSI)|Ln 1, Col 1(7 lines, 121 chars)
Tab Indent⌘↵ Run Query
Ready to execute. Press Run (⌘+Enter)
Write your query and click “Run” or press ⌘+Enter to inspect output.