认证介绍
持证人与会员
企业机构
授权合作伙伴
校园通道
观点与研究
关于CDA
新用户注册
考试报名
考试报名
考试内容
考试大纲
在线客服
返回顶部
备考刷题,请到
CDA认证小程序
题库分类
CDA I (适配2025年7月25日新考纲)
CDA LEVELⅠ 模拟题(四) 2025年7月新版
设数据库中有以下三张表:sc(sno,cno,grade),course(cno,cname,hours),student(sno,sname,ssex,sage,sdept)。试用SQL语言写出以下查询。(3)查询选课门数超过2门的学生的姓名、平均成绩和选课门数
A. SELECT student.sname 姓名,AVG(sc.grade) 平均成绩,COUNT(sc.sno) 选课门数FROM sc Left JOIN student ON sc.sno = student.sno GROUP BY student.sname HAVING COUNT(distinct sc.sno) >2;
B. SELECT student.sname 姓名,AVG(sc.grade) 平均成绩,COUNT(sc.cno) 选课门数FROM sc Left JOIN student ON sc.sno = student.sno GROUP BY student.sname HAVING COUNT(distinct sc.sno) >2;
C. SELECT student.sname 姓名,AVG(sc.grade) 平均成绩,COUNT(distinct sc.sno) 选课门数FROM sc left JOIN student ON sc.sno = student.sno GROUP BY student.sname HAVING COUNT(sc.sno) >2;
D. SELECT student.sname 姓名,AVG(sc.grade) 平均成绩,COUNT(distinct sc.cno) 选课门数FROM sc LEFT JOIN student ON sc.sno = student.sno GROUP BY student.sname HAVING COUNT(distinct sc.cno) >2;
上一题
下一题
收藏
点赞
评论
题目解析
题目评论
(0)
统计选课门数应该使用COUNT(distinct sc.cno)