您的位置:首页 > 数据库 > MySQL

MYSQL练习

2012-12-26 22:43 246 查看
1、按人名查找

select * from list where name='人名';

2、薪水大于等于4000查找

select * from list where salary>=4000;

3、每个部门多少人

select dept_id,count(*) from list group by dept_id;

4、每个部门平均薪水

select dept_id,avg(*) from list group by dept_id;

5、description为空的人

select * from list where description is NULL;

6、每个部门女员工薪水最高的

select dept_id,max(*) from list where genter='F' and group by dept_id;

7、名字以'l'开头的人

select * from list where name like 'l%';
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: