2022年SQL数据库系统期末试题 .pdf





《2022年SQL数据库系统期末试题 .pdf》由会员分享,可在线阅读,更多相关《2022年SQL数据库系统期末试题 .pdf(4页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、A 卷 第 1 页蚌埠学院20132014 学年第一学期SQL数据库系统 期末考试试题(A)注 意 事 项 : 1、 适 用 班 级 : 11 计算机科学与技术(本1、本 2、本 3 班)2、 本 试 卷 共 2 页 。 满 分 100 分 。3、 考 试 时 间 120 分 钟 。4、 考 试 方 式 : 闭 卷一、选择题(每小题1分,共 25 分)1、在 SQL SERVER中,使用update语句更新数据库表中的数据,以下说法正确的是( b ) 。(A)每次只能更新一行数据(B)每次可以更新多行数据(C)如果没有数据项被更新,将提示错误信息(D)更新数据时,必须带有WHERE 条件子句2
2、、在 SQL Server 2008中,要防止大于100 的数据被保存到int类型的列,可以使用( d ) 。(A)主键约束(B)限制约束(C)外键约束(D)检查约束3、在 SQL Server 2008 中,有 students(学生 ) 表,包含字段: Sid( 学号 ) ,SName( 姓名 ) ,Grade( 成绩 ) 。现要将所有学员的成绩加10 分。下列SQL语句正确的是( d ) 。(A)update students set Grade=Grade+10 where Sid=1 (B)update * set Grade=Grade+10 (C)update * from st
3、udents set Grade=Grade=Grade+10 (D)update students set Grade=Grade+10 4、在 SQL Server 2008 中,有一个product(产品 ) 表,包含子段:pname(产品名称 ) ,要从此表中筛选出产品名称为“苹果” 或者“香蕉” 的记录, 下列语句正确的是 ( c ) 。(A) SELECT*FROM product ON pname= 苹果 OR pname=香蕉(B) SELECT*FROM product ON pname=苹果 AND pname=香蕉(C) SELECT*FROM product WHERE
4、 pname= 苹果 OR pname=香蕉(D) SELECT*FROM product WHERE pname= 苹果 AND pname=香蕉5、在 SQL Server 2008中,附加数据库操作是指( b ) 。( A )把 SQL Server 数据库文件保存为其他数据库文件。( B )根据数据库物理文件中的信息,把数据库在SQL Server 2008中恢复。( C )把所有该数据库表的数据清空。( D )把数据库删除掉。6、在 SQL Sever 2008 中,假设表 users 包含主键列 id ,那么执行 “Update users SET id=20 WHERE id=3
5、0 ” ,执行的结果可能有( c ) 。( A )如果表中含有id 为 30 的记录,但不包含id 为 20 的记录,则更新失败。( B )执行出错,因为主键列不可以被更新。( C )如果表中同时含有id 为 20 和 id 为 30 的记录,则更新失败。( D )如果表中不包含id 为 20 和 id 为 30 的记录,则更新一行记录。7、在 SQL Sever 2008中,查找 student 表中所有身份证号码CardNo 的前三位为010或 020 的记录,以下语句正确的是( c ) 。( A )select * from student where cardno like 010%
6、and cardno like 020% ( B )select * from student where cardno like 010% or 020% ( C )select * from student where cardno like 01,20% ( D )select * from student where cardno like 0(1,2)0% 8、在 SQL Sever 2008 中,学生表student中包含以下字段:学生编号 sid (主键),学生姓名 sName ,现在查询所有姓名重复的记录,以下语句正确的是( b ) 。( A )select * from st
7、udent where count(sid)1 ( B )select a. * from student a, student b where a.sname=b.sname ( C ) select a.* from student a, student b where a.sname=b.sname and a.sidb.sid ( D )select * from student group by sName where count(sid)1 9、在 SQL Sever 2008 中,有系统数据库和用户数据库,下列不属于系统数据库的是( d ) 。( A )master (B) mo
8、del (C) msdb (D) pubs10、在 SQL Server 2008中,外键用于将一个表中的列与另一表中的列关联起来,为了确保引用的完整性,要求( a ) 。装订线内不要答题名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 4 页 - - - - - - - - - A 卷 第 2 页(A)外键列的列值必须已经存在于主键表的对应列的列值中(B)外键列的列值必须与主键表的对应列的列值一一对应(C)外键列不能有重复的值(D)外键表的数据行行数必须大于主键表的数据行
9、行数11、在SQL Server 2008中,现有定单表orders ,包含用户信息userid ,产品信息productid,以下( d )语句能够返回至少被定购过两回的productid。(A)select productid from orders group by productid where count(productid)1 (B)select productid from orders having count(productid)1 group by productid ( C) select productid from orders where having count(
10、productid)1 group by productid (D)select productid from orders group by productid having count(productid)1 12、在 SQL Server 2008 中,假定一个学生选修课管理系统中有两个表,包括:student (学生)表,其结构为:sID (学号 ) ,sName (姓名);studentCourse (学生选课)表,其结构为:sID (学号),cID (课程编号),score (成绩)。那么列出所有已选课学生的学号、姓名、课程编号和成绩的SQL语句是( bd ) 。(A)SELECT
11、 sID,sName ,cID, score FROM student,studentCourse (B)SELECT sID,sName ,cID, score FROM student INNER JOIN studentCourse ON student.sID=studentCourse.sID (C)SELECT sID,sName ,cID , score FROM student OUTER JOIN studentCourse ON student.sID=studentCourse.sID ( D) SELECT sID , sName, cID , score FROM s
12、tudent, studentCourse WHERE student.sID=studentCourse.sID 13、在 SQL Sever2008 中,假定grade (成绩)表中包含字段:sID(学号),cID (班级编号)、lang (语文成绩)、math(数学成绩) ,那么计算所有学生人数和各科最高成绩的SQL语句是() 。(A)SELECT COUNT(*),MAX(lang),MAX(math) FROM grade (B)SELECT COUNT(*),MAX(lang),MAX(math) FROM grade GROUP BY sID (C)SELECT SUM(*),M
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022年SQL数据库系统期末试题 2022 SQL 数据库 系统 期末 试题

限制150内