Back to problems

Find Highest Salary In Each Department

SQL · ByteDance · Medium

Problem You have two tables, employee and department. Write a SQL query that returns the employee or employees earning the maximum salary within each department. When several employees share that department's top salary, include every tied employee. Your query must determine the departmental maximum with a subquery. The subquery should join the relevant tables. Assume the tables have these columns: Return the department name, employee name, and salary for each qualifying…

Checking your access…