Workers With The Highest Salaries

You have been asked to find the job titles of the highest-paid employees.

Your output should include the highest-paid title or multiple titles with the same salary.

table name: worker

table name: title

Solution:
select t.worker_title  from title as t
join worker as w on t.worker_ref_id = w.worker_id
where w.salary = (select max(salary) from worker )
select top 1 with ties
t.worker_title
from worker w 
join title t on w.worker_id = t.worker_ref_id
order by w.salary desc
Excution Plan:


Comments (0)