查询员工表emp中的第3条到第8条记录。显示emp表中的全部字段。( )
A: select rownum rn,emp.* from emp where rownum3;
B: select * from(select rownum RN,emp.* from emp where RN3;
C: select * from(select rownum RN,emp.* from emp where rownum3;
D: select rownum RN,emp.* from emp where RN3;
A: select rownum rn,emp.* from emp where rownum3;
B: select * from(select rownum RN,emp.* from emp where RN3;
C: select * from(select rownum RN,emp.* from emp where rownum3;
D: select rownum RN,emp.* from emp where RN3;
举一反三
- 以下语句不正确的是( ) A: select * from emp; B: select ename,hiredate,sal from emp; C: select * from emp order deptno; D: select * from where deptno=1
- 以下语句不正确的是( ) A: select * from emp B: select ename,hiredate,sal from emp C: select * from emp order deptno D: select * from where deptno=1 and sal<300
- 设有职工基本表:EMP(ENO,ENAME,AGE,SEX,SALARY),其属性分别表示职工号、姓名、年龄、性别、工资。为每个工资低于平均工资的女职工加薪200元,以下SQL语句正确的是______。 A: UPDATE EMP SET SALARY=SALARY+200 B: WHERE SALAEY<(SELECT AVG(SALARY)FROM EMP) AND SEX=’女’ C: UPDATE FROM EMP SET SALARY=200 D: WHERE SALAEY<(SELECT SUM(SALARY)FROM EMP)AND SEX=’女’ E: UPDATE EMP SET SALARY=200 F: WHERE SALAEY<(SELECT AVG(SALARY)FROM EMP)AND SEX=’女’ G: UPDATE FROM EMP SET SALARY=SALARY+200 H: WHERE SALAEY<(SELECT SUM(SALARY)FROM EMP)AND SEX=’女’
- 统计每个部门中人数的语句是? A: select count(id) from emp order by deptno; B: select sum(id) from emp order by deptno; C: select count(id) from emp group by deptno; D: select sum(id) from emp group by deptno;
- 列出所有员工的姓名、部门名称和工资。正确的SQL语句有________。 A: SELECT a.ename <br> ,(SELECT b.dname FROM dept b) AS dname <br> ,sal <br>FROM emp a B: SELECT a.ename <br> ,(SELECT b.dname FROM dept b WHERE b.deptno=a.deptno) AS dname <br> ,sal <br>FROM emp a; C: SELECT a.ename,b.dname,sal <br>FROM emp a,dept D: SELECT a.ename,b.dname,sal <br>FROM emp a,dept b <br>WHERE a.deptno=b.deptno