查询平均成绩良好,也就是≥80分的考生人数,查询语句就可以写成____。
A: SELECT COUNT(*) FROM ( SELECT eeid,avg(achieve) FROM eeexam GROUP BY eeid ) AS avgach (eeid,avgachieve) WHERE avgachieve>=80;
B: SELECT COUNT(*) FROM (SELECT eeid,avg(achieve) FROM eeexam GROUP BY eeid ) avgach (eeid,avgachieve) WHERE avgachieve>=80;
C: SELECT dname, (SELECT COUNT(*) FROM examiner WHERE department.dname = examiner.erdepa)FROM departmentWHERE avgachieve>=80;
D: SELECT * FROM erexam NATURAL LEFT OUTER JOIN exampaper;
A: SELECT COUNT(*) FROM ( SELECT eeid,avg(achieve) FROM eeexam GROUP BY eeid ) AS avgach (eeid,avgachieve) WHERE avgachieve>=80;
B: SELECT COUNT(*) FROM (SELECT eeid,avg(achieve) FROM eeexam GROUP BY eeid ) avgach (eeid,avgachieve) WHERE avgachieve>=80;
C: SELECT dname, (SELECT COUNT(*) FROM examiner WHERE department.dname = examiner.erdepa)FROM departmentWHERE avgachieve>=80;
D: SELECT * FROM erexam NATURAL LEFT OUTER JOIN exampaper;
举一反三
- 查询平均成绩良好, 也就是≥80 分的考生人数, 查询语句就可以写成____。 A: SELECT COUNT(*) FROM (SELECT eeid,avg(achieve) FROM eeexam GROUP BY eeid) AS avgach (eeid,avgachieve)WHERE avgachieve>=80; B: SELECT COUNT(*)FROM (SELECT eeid,avg(achieve)FROM eeexamGROUP BY eeid) avgach (eeid,avgachieve)WHERE avgachieve>=80; C: SELECT dname,(SELECT COUNT(*)FROM examinerWHERE department.dname = examiner.erdepa)FROM departmentWHERE avgachieve>=80; D: SELECT *FROM erexam NATURAL LEFT OUTER JOIN exampaper;
- 列出所有部门的部门名称和部门员工人数。如果部门没有员工,人数显示为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
- 查询最少选修了3门课程的学生学号和姓名,正确的SQL语句是()。 A: SELECT 学号,姓名,COUNT(*) FROM 选课成绩 WHERE COUNT(*)>=3 GROUP BY 学号 B: SELECT 学号,姓名,COUNT(*) FROM选课成绩 WHERE COUNT(*)>=3 GROUP BY学号,姓名 C: SELECT 学号,姓名,COUNT(*) FROM 选课成绩 GROUP BY学号HAVING COUNT(*)>=3 D: SELECT 学号,姓名,COUNT(*) FROM 选课成绩 GROUP BY学号,姓名 HAVING COUNT(*)>=3
- 查找成绩在70到80分之间的学生选课及得分情况。正确的SQL语句是( )。 A: SELECT * FROM 选课 WHERE 成绩>=70 AND 成绩<=80 B: SELECT * FROM 选课 WHERE 成绩≥70 AND 成绩≤80 C: SELECT * FROM 选课 WHERE 成绩>='70’ OR 成绩<='80’ D: SELECT * FROM 选课 WHERE 成绩>=70 OR 成绩<=80
- 查询最低成绩大于85分的学生学号和平均成绩,可以使用的查询语句是: 。 A: SELECT Sno, AVG(Grade) FROM SC HAVING MIN(Grade) > 85 GROUP BY Sno; B: SELECT Sno, AVG(Grade) FROM SC GROUP BY Sno HAVING MIN(Grade) > 85; C: SELECT Sno, AVG(Grade) FROM SC WHERE MIN(Grade) > 85 GROUP BY Sno; D: SELECT Sno, AVG(Grade) FROM SC GROUP BY Sno WHERE MIN(Grade) > 85;