How to rewrite this correlated query as a JOIN?
One variant:

SELECT
  a.dept,
  a.name,
  b.salary
FROM employees AS a 
JOIN (
  SELECT
    MAX(c.salary) salary,
    c.dept
  FROM employees AS c
GROUP BY c.dept
) b
  ON a.dept = b.dept


If you are using TSQL you can replace JOIN with CROSS APPLY on move ON clause inside and replace it with WHERE