• 2022-06-29
    列出所有部门的部门名称和部门员工人数。如果部门没有员工,人数显示为0。正确的查询语句有_________。
    A: SELECT dname,COUNT(ename) AS ecount
    FROM dept,emp
    WHERE emp.deptno(+)=dept.deptno
    GROUP BY dept.dname
    B: SELECT dname,(SELECT COUNT(*) AS ecount FROM emp WHERE emp.deptno=dept.deptno)
    FROM dept
    C: SELECT dname,COUNT(ename) AS ecount
    FROM dept LEFT JOIN emp ON emp.deptno=dept.deptno
    GROUP BY dept.dname
    D: SELECT dname,COUNT(*) AS ecount
    FROM dept LEFT JOIN emp ON emp.deptno=dept.deptno
    GROUP BY dept.dname
  • A,B,C

    内容

    • 0

      Consider the following query:SELECT dname, ename FROM dept d, emp e Where d.deptno=c.deptno ORDER BY dname, ename;What type of join is shown?() A: Self-join B: Equijoin C: Outerjoin D: Non-equijoin

    • 1

      以下语句不正确的是( ) A: select * from emp; B: select ename,hiredate,sal from emp; C: select * from emp order deptno; D: select * from where deptno=1

    • 2

       以下语句不正确的是(     ) 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

    • 3

      以下语句正确的是() A: select<br/>sal+1 from emp; B: select<br/>sal*10,sal*deptno from emp; C: 不能使用运算符号 D: select<br/>sal*10,deptno*10 from emp;

    • 4

      SQL语句“SELECT<br/>* FROM emp WHERE ename LIKE 'A_'”能够查询字母<br/>A<br/>开头的所有雇员信息。()