表连接,连接条件为员工编号相同,然后算平均值,根据平均值排序 select title,avg(salary) as 'avg(s.salary)' from titles t join salaries s on t.emp_no = s.emp_no group by title order by avg(salary) ;