第三章 关系数据库标准语言SQL

单表查询

1、单选题:
​从学生成绩表SC中查询平均成绩大于60分的同学的学号和平均成绩的正确语句为:‎
选项:
A: select sno,avg(score) as sscore from sc group by sno having avg(score) >60 
B: select sno,avg(score) as sscore from sc group by sno where avg(score) >60
C: select sno,avg(score) as sscore from sc where avg(score) >60
D: select sno,avg(score) as sscore from sc having avg(score) >60
答案: 【 select sno,avg(score) as sscore from sc group by sno having avg(score) >60 

2、单选题:
‌从学生表student中查询所有学生的学号,姓名,年龄的正确语句为:​
选项:
A: select sno,sname,ssex from student
B: select sno sname ssex from student
C: select 学号 sno,姓名 sname,性别 ssex from student
D: select sno 学号,sname 姓名,ssex 性别 from student
答案: 【 select sno,sname,ssex from student

3、单选题:
‎从sc表中查询了选修课程的学生学号,去掉重复行的正确语句为‌
选项:
A: select sno from sc
B: select sno from sc where cno=’1’ or cno=’2’ or cno=’3’
C: select distinct sno,’学号’ from sc
D: select sno from sc where cno<>null
答案: 【 select distinct sno,’

剩余75%内容付费后可查看

发表评论

电子邮件地址不会被公开。 必填项已用*标注