
Answer-first summary for fast verification
Answer: SELECT Department, MAX(Salary) AS HighestSalary FROM Employees GROUP BY Department;
Option A correctly finds the highest paid employee in each department. Options B, C, and D either do not calculate the maximum salary correctly or do not group by the department correctly.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are working with a lakehouse in Fabric that contains a table named 'Employees' with columns 'EmployeeID', 'FirstName', 'LastName', 'Department', and 'Salary'. You need to write a SQL query to find the highest paid employee in each department. How would you structure this query?
A
SELECT Department, MAX(Salary) AS HighestSalary FROM Employees GROUP BY Department;
B
SELECT Department, Salary AS HighestSalary FROM Employees;
C
SELECT Department, MAX(Salary) AS HighestSalary FROM Employees;
D
SELECT Department, Salary AS HighestSalary FROM Employees GROUP BY Department;
No comments yet.