Practice Employees Earning More Than Their Managers
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Tables: Employee(id INT, name VARCHAR, salary INT, managerId INT). Employee.id is unique and managerId identifies the employee's manager. Return the names of employees whose salary is strictly greater than their manager's salary, under the output column Employee. Employees without a matching manager do not qualify. Output order is unrestricted.
Source: Employees Earning More Than Their Managers on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Employee table: +----+-------+--------+-----------+ | id | name | salary | managerId | +----+-------+--------+-----------+ | 1 | Joe | 70000 | 3 | | 2 | Henry | 80000 | 4 | | 3 | Sam | 60000 | Null | | 4 | Max | 90000 | Null | +----+-------+--------+-----------+
+----------+ | Employee | +----------+ | Joe | +----------+
Related LeetCode Problems
Practice more problems similar to Employees Earning More Than Their Managers.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.