查询scott用户的emp表中的总记录数,可以使用下列哪个语句?()
A: SELECT MAX(empno) FROM scott.emp;
B: SELECT
COUNT(empno) FROM scott.emp;
C: SELECT COUNT(comm) FROM scott.emp;
D: SELECT COUNT(*) FROM scott.emp;
A: SELECT MAX(empno) FROM scott.emp;
B: SELECT
COUNT(empno) FROM scott.emp;
C: SELECT COUNT(comm) FROM scott.emp;
D: SELECT COUNT(*) FROM scott.emp;
举一反三
- 统计每个部门中人数的语句是? 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;
- 查询scott用户的emp表中的总记录数,可以使用下列哪个语句?
- 查询员工表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 * from emp; B: select ename,hiredate,sal from emp; C: select * from emp order deptno; D: select * from where deptno=1
- 列出所有部门的部门名称和部门员工人数。如果部门没有员工,人数显示为0。正确的查询语句有_________。 A: SELECT dname,COUNT(ename) AS ecount <br>FROM dept,emp <br>WHERE emp.deptno(+)=dept.deptno <br>GROUP BY dept.dname B: SELECT dname,(SELECT COUNT(*) AS ecount FROM emp WHERE emp.deptno=dept.deptno) <br>FROM dept C: SELECT dname,COUNT(ename) AS ecount <br>FROM dept LEFT JOIN emp ON emp.deptno=dept.deptno <br>GROUP BY dept.dname D: SELECT dname,COUNT(*) AS ecount <br>FROM dept LEFT JOIN emp ON emp.deptno=dept.deptno <br>GROUP BY dept.dname