查询平均成绩良好, 也就是≥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;
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;
举一反三
- 查询平均成绩良好,也就是≥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;
- 列出所有部门的部门名称和部门员工人数。如果部门没有员工,人数显示为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
- 查询选修了数学课(课程号为2)的学生人数,可以使用的查询语句是: 。 A: SELECT MAX(*) FROM SC WHERE Cno = 2; B: SELECT AVG(Sno) FROM SC WHERE Cno = 2; C: SELECT COUNT(*) FROM SC WHERE Cno = 2; D: SELECT COUNT(Sname) FROM SC WHERE Cno = 2;
- 根据关系模型Students(学号,姓名,性别,专业,成绩),统计学生的平均成绩应使用的SQL语句是______。 A: SELECT AVG(成绩)FROM Students B: SELECT COUNT(成绩) FROM Students C: SELECT COUNT(*) FROM Students D: SELECT AVG(*) FROM Students
- 查询所有成绩均大于80分的学生姓名,应执行( )语句 A: SELECT SNAME FROM STUDENT WHERE EXISTS (SELECT *FROM SC WHERE STUDENSNO = SC.SNO AND GRADE> 80); B: SELECT SNAME FROM STUDENT WHERE EXISTS (SELECT *FROM SC WHERE STUDENSNO = SC.SNO AND GRADE C: SELECT SNAME FROM STUDENT WHERE NOT EXISTS (SELECT *FROM SC WHERE STUDENSNO = SC.SNO AND GRADE D: SELECT SNAME FROM STUDENT WHERE NOT EXISTS (SELECT *FROM SC WHERE STUDENSNO = SC.SNO AND GRADE> 80);