mysql查询

 

 

1. 按名字查找

Select * from yuangong where name=’’;

2. 按薪水大于1000查找

Select * from yuangong where salary>1000;

3. 部门人数

Select  dept_id,count(*) as total from yuangong group by dept_id;

4. 部门平均薪资

Select dept_id,avg(salary) from yuangong group by dept_id;

5. 描述为空的

Select * from yuangong where description is null;

6. 每个部门女员工薪水最大值

Select dept_id,max(salary) from yuangong where gende='f' group by dept_id having ;

7. 名字以l开头的

Select * from yuangong where name like ‘l%’;

 

你可能感兴趣的:(mysql,查询)