Xebia's People Analytics team needs to identify the employees receiving the highest salary. Write a PostgreSQL query that returns every employee whose salary equals the maximum salary recorded in the employee table, along with the department information available in the department table.
Requirements
- Return the employee name, department name, and salary for every employee tied for the maximum salary.
- Use a subquery or equivalent aggregation to determine the maximum salary, rather than hardcoding a value.
- Preserve employees even when their department is missing, displaying a
NULL department name in that case.
- Sort the results alphabetically by employee name.