1、创建数据表employee和dept,并插入数据
2、在employee表中,查询所有记录的e_no,e_name和e_salary字段值
3、在employee表中,查询dept_no等于10和20的所有记录
4、在employee表中,查询工资范围在800~2500之间的员工信息
5、在employee表中,查询部门编号为20的部门中的员工信息
6、在employee表中,查询每个部门最高工资的员工信息
7、查询员BLAKE所在部门和部门所在地
8、使用连接查询、查询所有员工的部门和部门信息
9、在employee表中,计算每个部门各多少名员工
10、在employee表中,计算不同类型职工的总工资数
11、在employee表中,计算不同部门的平均工资
12、在employee表中,查询工资低于1500的员工信息
13、在employee表中,将查询记录先按照部门编号由高到低排列,在按员工工资由高到低排列
14、在employee表中,查询员工姓名以字母A或S开头的员工信息
15、在employee表中,查询到目前为止,工龄大于等于10年的员工信息
1.第一个实验在上个实验报告里面
2. mysql> select e_no,e_name,e_salary from employee;
3. mysql> select * from employee where dept_no between 10 and 20;
4. mysql> select * from employee where e_salary between 800 and 2500;
5. mysql> select * from employee where dept_no=20;
6.mysql>select count(e_job),e_job,group_concat(e_salary),max(e_salary) from employee group by e_job;
7. mysql> select * from employee where e_name="BLAKE";
8.不用做
9. mysql> select count(e_no) from employee;
10.mysql>select count(e_job),e_job,group_concat(e_salary),sum(e_salary) from employee group by e_job;
11. mysql> select e_job,avg(e_salary) from employee group by e_job;
mysql>select count(e_job),e_job,group_concat(e_salary),avg(e_salary) from employee group by e_job;
12. mysql> select * from employee where e_salary < 1500;
13. mysql> select * from employee order by dept_no desc,e_salary desc;
14. mysql> select * from employee where e_name like "A%";
mysql> select * from employee where e_name regexp "^S";a
mysql> select * from employee where e_name like "A%" or e_name regexp "^S";
15.不用做!