A.求每个部门中的工资
B.求每个部门中工资的大小
C.求每个部门中工资的总和
D.求每个部门中工资的个数
第1题:
求至少有两个职工的每个仓库的平均工资______。
A.SELECT仓库号,COUNT(*),AVG(工资)FROM职工表; HAVINGCOUNT(*)>=2
B.SELECT仓库号,COUNT(*),AVG(工资)FROM职工表; GROUPBY仓库号HAVING COUNT(*)>=2
C.SELECT仓库号,COUNT(*),AVG(工资)FROM职工表; GROUPBY仓库号SET COUNT(*)>=2
D.SELECT仓库号,COUNT(*),AVG(工资)FROM职工表; GROUPBY仓库号WHERE COUNT(*)>=2
第2题:
对由SELECT--FROM—WHERE—GROUP--ORDER组成的SQL语句,其在被DBMS处理时,各子句的执行次序为()
A.SELECT—FROM—GROUP—WHERE—ORDER
B.FROM——SELECT--WHERE——GROUP——ORDER
C.FROM——WHERE——GROUP——SELECT——ORDER
D.SELECT——FROM——WHERE——GROUP——ORDER
第3题:
列出薪水高于所在部门平均工资的员工信息()。
A.select deptno,ename,sal from emp a where sal> (select avg(a.sal) from emp where deptno=a.deptno);
B.select deptno,ename,sal from emp a where sal> (select avg(sal) from emp where deptno=a.deptno);
C.select a.deptno,a.ename,a.sal from emp a,emp b where a.deptno=b.deptno and a.sal>avg(b.sal);
D.select a.deptno,a.ename,a.sal from emp a,emp b where a.deptno=b.deptno and b.sal>avg(a.sal);
第4题:
求至少有两个职工的每个仓库的平均工资
A.SELECT 仓库号,COUNT(*),AVG(工资)FROM 职工表;
HAVING COUNT(*)>=2
B.SELECT 仓库号,COUNT(*),AVG(工资)FROM 职工表;
GROUP BY 仓库号 HAVING COUNT(*)>=2
C.SELECT 仓库号,COUNT(*),AVG(工资)FROM 职工表;
GROUP BY 仓库号 SET COUNT(*)>=2
D.SELECT 仓库号,COUNT(*),AVG(工资)FROM 职工表;
GROUP BY 仓库号 WHERE COUNT(*)>=2
第5题:
A.select empno ,sum(sal) from scott.emp group by deptno
B.select * from scott.emp
C.select sum(sal) from scott.emp group by deptno
D.select count(empno) from scott.emp
第6题:
列出所有部门的职工人数(包括没有职工的部门) ()。
A.select dept.deptno,dname,count(emp.empno) from emp,dept where emp.deptno=dept.deptno group by dept.deptno,dname;
B.select dept.deptno,dname,count(emp.empno) from emp,dept where emp.deptno()=dept.deptno group by dept.deptno,dname;
C.select dept.deptno,dname,count(emp.empno) from emp,dept where emp.deptno=dept.deptno() group by dept.deptno,dname;
D.select dept.deptno,dname,count(emp.empno) from emp,dept where emp.deptno(