Skip to content
Programming101
Programming101

Learn everything about programming

  • Home
  • CS Subjects
    • IoT – Internet of Things
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
  • HackerRank Solutions
    • HackerRank Algorithms Solutions
    • HackerRank C problems solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
Programming101
Programming101

Learn everything about programming

Leetcode Employees Earning More Than Their Managers problem solution

YASH PAL, 31 July 2024

In this Leetcode Employees Earning More Than Their Managers problem solution, we have given the Employee table, write a SQL query that finds out employees who earn more than their managers.

Leetcode Employees Earning More Than Their Managers problem solution

Problem solution in Mysql.

SELECT Name Employee FROM Employee a
WHERE Salary > (SELECT Salary FROM Employee b WHERE a.ManagerId = b.Id)

Problem solution in Oracle.

select e.name Employee from employee e , employee m 
where e.managerid = m.id
and e.salary > m.salary

Problem solution using Join.

select 
e1.Name
from Employee e1 join Employee e2
on e1.ManagerId = e2.Id and e1.Salary>e2.Salary

coding problems

Post navigation

Previous post
Next post
  • How AI Is Revolutionizing Personalized Learning in Schools
  • GTA 5 is the Game of the Year for 2024 and 2025
  • Hackerrank Day 5 loops 30 days of code solution
  • Hackerrank Day 6 Lets Review 30 days of code solution
  • Hackerrank Day 14 scope 30 days of code solution
©2025 Programming101 | WordPress Theme by SuperbThemes