mysql 习题总结

mysql 习题总结_第1张图片

1.select sex,avg(salsry) as '平均薪资' from emp group by sex;

2.select depart,sum(salsry) from emp group by depart;

3.select depart ,sum(salary) from emp group by depart order by sum(salary) desc limit 1,1;

4.select name from emp group by name having count(name)>1;

5.select depart,avg(salary) from emp where sex = '男' and salary>10000 group by depart;

mysql 习题总结_第2张图片

你可能感兴趣的:(mysql,数据库)