1这是表的数据:createtableemp_hiloo(empnoint(8),enamevarchar(20),jobvarchar(15),salaryint(8),bonusint(8),hiredatedate,mgrint(8),deptnoint(8));insertintoemp_hiloovalues(10...
1 这是表的数据:
create table emp_hiloo(empno int(8),ename varchar(20),job varchar(15),salary int(8),bonus int(8),hiredate date,mgr int(8),deptno int(8));insert into emp_hiloo values (1001,'zhangwuji','Manager',10000,2000,'2012-8-03',1005,10);insert into emp_hiloo values(1002,'liucangsong','Analyst',8000,1000,'2011-8-03',1001,10);insert into emp_hiloo values(1003,'liyi','Analyst',9000,1000,'2010-6-11',1001,10);insert into emp_hiloo values (1004,'guofurong','Programmer',5000,null,'2012-5-03',1001,10);insert into emp_hiloo values(1005,'zhangsanfeng','President',15000,null,'2011-12-5',null,20);insert into emp_hiloo values (1006,'yanxiaoliu','Manager',5000,400,'2009-1-5',1005,20);insert into emp_hiloo values(1007,'luwushuang','clerk',3000,500,'2008-6-5',1006,20);insert into emp_hiloo values (1008,'huangrong','Manager',5000,500,'2004-2-5',1005,30);insert into emp_hiloo values (1009,'weixiaobao','salesman',4000,null,'2009-8-6',1008,30);insert into emp_hiloo values (1010,'guojing','salesman',4500,500,'2005-6-5',1008,30);
要求:
用mysql语句查询出工资大于其所在部门平均工资的员工信息,列出员工名,薪水,所在部门的平均工资。
展开