Boss: top 3 per team
Top-N per group is the classic window query: number the rows in each group, keep the first N.
task
Top 3 earners per team, ties broken by hire date then emp_id, with their gap to the team's maximum salary: columns team_id, emp_id, salary, gap, rn. Ordered by team_id, rn.