2018年3月计算机等级考试即将开始啦,小编在这里为考生们整理了2018年计算机三级数据库技术习题答案,希望能帮到大家,想了解更多资讯,请关注出国留学网的及时更新哦。
2018年计算机三级数据库技术习题答案八
第6章 高级数据查询
1[单选题] 设在某SELECT语句的WHERE子句中,需要对Grade列的空值进行处理。下列关于空值的操作中,错误的是__________。
A.Grade IS NOT NULL
B.Grade IS NULL
C.Grade = NULL
D.NOT (Grade IS NULL)
参考答案:C
2[单选题]
现要利用Student表查询年龄最小的学生的姓名和年龄。下列实现此功能的查询语句中,正确的是__________。
A.SELECT Sname, MIN(Sage) FROM Student
B.SELECT Sname, Sage FROM Student WHERE Sage = MIN(Sage)
C.SELECT TOP 1 Sname, Sage FROM Student
D.SELECT TOP 1 Sname, Sage FROM Student ORDER BY Sage
参考答案:D
3[单选题]
设SC表中记录成绩的列为:Grade,类型为int。若在查询成绩时,希望将成绩按“优”、“良”、“中”、“及格”和“不及格”形式显示,正确的Case函数是__________。
A.Case GradeWhen 90~100 THEN'优'When 80~89 TIIEN'良'When 70~79 THEN'中'When 60~69 THEN'及格'。 Else'不及格’End
B.CaseWhen Grade between 90 and 100 THEN Grade='优'When Grade between 80 and 89 THEN Grade='良'When Grade between 70 and 79 THEN Grade='中'When Grade between 60 and 69 THEN Grade='及格’Else Grade='不及格’End
C.Case When Grade between 90 and 100 THEN'优'When Grade between 80 and 89 THEN'良’When Grade between 70 and 79 THEN'中’When Grade between 60 and 69 THEN'及格’Else'不及格’End
D.Case GradeWhen 90~100 THEN Grade='优’When 80~89 THEN Grade='良’When 70~79 THEN Grade='由’When 60~69 THEN Grade='及格’Else Grade='不及格’End
参考答案:C
4[单选题]
下述语句的功能是将两个查询结果合并为一个结果,其中正确的是__________。
A.select sno,sname, sage from student where sdept = 'cs 'Order by sageUnionselect sno,sname,sage from student where sdept = 'is'Order by sage
B.select sno,sname, sage from student where sdept = 'cs 'Unionselect sno,sname, sage from student where sdept = 'is 'Order by sage
C.select sno,sname,sage from student where sdept = 'cs 'Unionselect sno,sname from student where sdept = 'is'Order by sage
D.select sno,sname,sage from student where sdept = 'cs'Order by sageUnionselect sno,shame, sage fron student where sdept = 'is'
参考答案:B
5[单选题]
在SQL Server 2000中,有学生表(学号,姓名,年龄),其中“姓名”的数据类型是:char(10)。现要查询姓“张”且名字是三个字的学生的详细信息,正确的语句是__________。
A.SELECT*FROM学生表WHERE姓名LIKE'张_’
B.SELECT*FROM学生表WHERE姓名LIKE'张_’
C.SELECT*FROM学生表WHERE姓名LIKE'张_'AND LEN(姓名)=3
D.SELECT*FROM学生表WHERE姓名LIKE'张_'AND LEN(姓名)=4
参考答案:C
推荐阅读:
出国留学网计算机等级考试 栏目推荐: