3.查询句子中,错误的是( )。? ? ?
A.SELECT Sno, COUNT(*) FROM SC GROUP BY Sno
B.SELECT Sno FROM SC GROUP BY Sno WHERE COUNT(*) > 3
C.SELECT Sno FROM SC GROUP BY Sno HAVING COUNT(*) > 3
D.SELECT Sno FROM SC GROUP BY Sno
4.现要使用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
刺进句子中,不能正确履行的是( )。? ?
A.INSERT INTO Teachers VALUES(\'T100\',\'张宏\',NULL)
B.INSERT INTO Teachers(Tno,Tname,Age) VALUES(\'T100\',\'张宏\',30)
C.INSERT INTO Teachers(Tno,Tname) VALUES(\'T100\',\'张宏\')
D.INSERT INTO TeachersVALUES(\'T100\',\'张宏\')
9.删去计算机系学生(在student表中)的修课记载(在SC表中)的句子,正确的是( )。
A.DELETE? FROM SC JOIN Student b ON S.Sno = b.Sno
WHERE Sdept = \'计算机系\'
B.DELETE FROM SC FROM SC JOIN Student b ON SC.Sno = b.Sno
WHERE Sdept = \'计算机系\'
C.DELETE FROM Student? WHERE Sdept = \'计算机系\'
D.DELETE FROM SC WHERE Sdept = \'计算机系\'
10.查询年纪最大的前5位学生的名字和年纪的句子,正确的是( )。
A.SELECT TOP 5 名字, 年纪 FROM 学生表
B.SELECT TOP 5 名字, 年纪 FROM 学生表 ORDER BY 年纪
C.SELECT TOP 5 名字, 年纪 FROM 学生表 ORDER BY 年纪 DESC
D.SELECT TOP 5 WITH TIES名字, 年纪 FROM 学生表
二.判别题(每小题2分,共5个题,10分)
11.SELECT * FROM Student WHERE Sname LIKE? \'张_\' 句子中的\'张_\' 用于查找姓张的学生。( )
12.SELECT * FROM Student WHERE Sname LIKE? \'[张李刘]%\' 句子能够查找姓张、李、刘的学生。( )
13.SELECT COUNT(DISTINCT Sno) FROM SC 句子用于统计学生的总人数。( )
试卷总分:40 得分:100
一.单项挑选题(每小题3分,共10个题,30分)
1.当关系R和S进行衔接操作时,假如R中的元组不满意衔接条件,在衔接成果中也会将这些记载保存下来的操作是( )。? ?
A.左外衔接
B.右外衔接
C.内衔接
D.自衔接
2.聚合函数中,不疏忽空值的是( )。? ? ??
A.SUM(列名)?
B.MAX(列名)
C.AVG(列名)
D.COUNT(*)
3.查询句子中,错误的是( )。? ? ?
A.SELECT Sno, COUNT(*) FROM SC GROUP BY Sno
B.SELECT Sno FROM SC GROUP BY Sno WHERE COUNT(*) > 3
C.SELECT Sno FROM SC GROUP BY Sno HAVING COUNT(*) > 3
D.SELECT Sno FROM SC GROUP BY Sno
4.现要使用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
5.设SC表中记载分数的列为:Grade,类型为int。若在查询分数时,期望将分数按‘优’、‘良’、‘中’、‘及格’和‘不及格’方式显现,正确的Case函数是( )。?????
A.Case Grade
When 90~100? THEN? \'优\'
When 80~89? THEN? \'良\'
When 70~79? THEN? \'中\'
When 60~69? THEN? \'及格\'
Else? \'不及格\'
End
B.Case
When 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 Grade
When 90~100? THEN Grade = \'优\'
When 80~89? THEN Grade = \'良\'
When 70~79? THEN Grade = \'中\'
When 60~69? THEN Grade = \'及格\'
Else? Grade = \'不及格\'
End
6.在SQL句子中,用于更新表数据的句子是( )。? ??
A.ALTER
B.SELECT
C.UPDATE??
D.INSERT
7.设有Teachers表,该表的界说如下:
??? CREATE TABLE Teachers(
??? ? Tno CHAR(8) PRIMARY KEY,
????? Tname VARCHAR(10) NOT NULL,
????? Age TINYINT CHECK(Age BETWEEN 25 AND 65) )
刺进句子中,不能正确履行的是( )。? ?
A.INSERT INTO Teachers VALUES(\'T100\',\'张宏\',NULL)
B.INSERT INTO Teachers(Tno,Tname,Age) VALUES(\'T100\',\'张宏\',30)
C.INSERT INTO Teachers(Tno,Tname) VALUES(\'T100\',\'张宏\')
D.INSERT INTO TeachersVALUES(\'T100\',\'张宏\')
8.设数据库中已有表5-1至5-3所示的Student、Course和SC表。现要查询学生选的第2学期开设课程的状况,只需列出学号、名字、地点系和所选的课程号。该查询触及到的表是( )。?????
A.仅Student表
B.仅Student和SC表
C.仅Student和Course表
D.Student、SC和Course表
9.删去计算机系学生(在student表中)的修课记载(在SC表中)的句子,正确的是( )。
A.DELETE? FROM SC JOIN Student b ON S.Sno = b.Sno
WHERE Sdept = \'计算机系\'
B.DELETE FROM SC FROM SC JOIN Student b ON SC.Sno = b.Sno
WHERE Sdept = \'计算机系\'
C.DELETE FROM Student? WHERE Sdept = \'计算机系\'
D.DELETE FROM SC WHERE Sdept = \'计算机系\'
10.查询年纪最大的前5位学生的名字和年纪的句子,正确的是( )。
A.SELECT TOP 5 名字, 年纪 FROM 学生表
B.SELECT TOP 5 名字, 年纪 FROM 学生表 ORDER BY 年纪
C.SELECT TOP 5 名字, 年纪 FROM 学生表 ORDER BY 年纪 DESC
D.SELECT TOP 5 WITH TIES名字, 年纪 FROM 学生表
二.判别题(每小题2分,共5个题,10分)
11.SELECT * FROM Student WHERE Sname LIKE? \'张_\' 句子中的\'张_\' 用于查找姓张的学生。( )
12.SELECT * FROM Student WHERE Sname LIKE? \'[张李刘]%\' 句子能够查找姓张、李、刘的学生。( )
13.SELECT COUNT(DISTINCT Sno) FROM SC 句子用于统计学生的总人数。( )
14.HAVING子句用于对分组后的统计成果再进行过滤,它用于组而不是对单个记载。( )
15.SELECT * FROM Student INNER JOIN? SC
ON Student.Sno = SC.Sno? 句子可将Student与 SC衔接起来。( )
专业辅导各院校在线、离线考核、形考、终极考核、统考、社会调查报告、毕业论文写作交流等!(非免费)
联系我们:QQ客服:3326650399 439328128 微信客服①:cs80188 微信客服②:cs80189
扫一扫添加我为好友 扫一扫添加我为好友