How can we display the department's top salary on every employee's record?
FIRST_VALUE(column) retrieves the value from the initial row of the window frame.
Benchmarking employees against the department highest earner, baseline comparisons.
SELECT
department_id,
name,
salary,
FIRST_VALUE(salary) OVER (
PARTITION BY department_id
ORDER BY salary DESC
) AS highest_salary
FROM employees;Practice typing production-grade SQL code for First Value.