Listing 3: Query That Finds the Employee with the Highest Salary in Each Department SELECT dept_id, last_name, salary FROM (SELECT dept_id, last_name, MAX(salary) OVER (PARTITION BY dept_id) max_sal_dept, salary FROM employee) AS part_deptid WHERE salary = max_sal_dept