Your question is Employee vs Manager Salary Query. Start with the requirements and the one table on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Chewy’s people analytics team wants to identify compensation anomalies for review. An employee qualifies when their salary is strictly greater than the salary of their directly assigned manager.
Write a PostgreSQL query using a self-join on employees to return every employee whose salary exceeds their manager’s salary.
| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee’s full name |
| salary | NUMERIC(10,2) | Annual employee salary |
| manager_id | INT | References employees.employee_id for the direct manager |
| department | VARCHAR(50) | Organizational department |