What is the average salary of all teams?
select avg(salary) from salary
What is the average salary of each team?
select t1.name, avg(t2.salary) from team as t1 join salary as t2 on t1.team_id = t2.team_id group by t1.team_id;
What is the highest salary of each team?
select t1.name, max(t2.salary) from team as t1 join salary as t2 on t1.team_id = t2.team_id group by t1.team_id;
Please also give the team name, id and maximum salary.
select t1.name, t1.team_id, max(t2.salary) from team as t1 join salary as t2 on t1.team_id = t2.team_id group by t1.team_id;