SQL-16 题解
统计出当前各个title类型对应的员工当前薪水对应的平均工资
http://www.nowcoder.com/questionTerminal/c8652e9e5a354b879e2a244200f1eaae
统计出各个title类型对应的员工薪水对应的平均工资avg。结果给出title以及平均工资avg,并且以avg升序排序
员工职称表和薪酬表通过员工号链接,用职称分类后以平均薪酬升序(默认)排列。
select t.title,avg(s.salary) as average from titles as t join salaries as s on t.emp_no = s.emp_no group by t.title order by average