2019年整理电大考试复习资料电大专科《数据库基础与应用》期末复习试题及参考答案资料

发布时间:2019-04-13 18:19:40

电大专科《数据库基础与应用》期末复习试题及参考答案资料小抄

训练第一套

一、单项选择题,把合适的选项编号填写在括号内。(每小题2,20)

1.域是实体中相应属性的(A)。

A. 取值范围 B. C. 名称 D. 描述

2.把保存关系定义的关系称为对应数据库的(B)。

A. 一般关系 B. 元关系 C. 特定关系 D. 正常关系

3.在一个关系R中,若存在XYXZ,则存在X(Y,Z),称此为函数依赖的(C)规则。

A. 传递性 B. 分解性 C. 合并性 D. 增广性

4. 设一个关系为R(A,B,C,D,E,F),它的最小函数依赖集为FD={AB,AC,DE,DF},则该关系的候选码为(D)。

A. (A,B) B. (A,C)

C. (A,E) D. (A,D)

5.在SQL中,对基本表进行插入和修改记录的命令为(D)。

A. insertdelete B. updatedelete

C. deleteselect D. insertupdate

6Access2000数据库是(C)型数据库。

A.层状 B.网状 C.关系 D.树状

7.如果字段内容为声音文件,可将此字段定义为(C)类型。

A.文本 B.查询向导 COLE对象 D.备注

8.在建交叉表查询的过程中,最多可以选择(B)个行标题字段。

A2 B3 C4 D5

9.若要退出Microsoft Access,则应使用的操作是(C)。

AExit BReturn CQuit DRevoke

10.显示包含警告信息或其他信息的消息框,应该使用的操作是(D)。

AEcho BMessage CWarn DMsgBox

二、是非判断题,若叙述正确则在题目后括号内打“√”否则打“×”(每小题2,20)

1.当建立和删除一个视图时,对相应的基本表没有影响。(√)

2.由概念设计进入逻辑设计时,原来的111对多联系通常都需要被转换为对应的基本表。(×)

3.概念设计也要贯彻概念单一化原则,即一个实体中的所有属性都是直接用来描述码的。(√)

4.在对象数据模型中,对象既不能够继承,也不能够嵌套。(×)

5.设一个学生关系为S(学生号,姓名),课程关系为C(课程号,课程名),选课关系为X(学生号,课程号,成绩),求出所有选课的学生信息的运算表达式为学生号(X)S的自然连接。(√)

6. 索引不是一种改善数据库性能的技术。(×)

7. 声明游标语句的关键字为DECLARE CURSOR,该语句不一定带有SELECT查询子句。(×)

8. 在收回用户访问权限的语句中,所给表名选项以关键字ON开始,所给用户名选项以关键字FROM开始。(√)

9. 用于配置客户端网络连接的工具是客户端网络实用工具。(√)

10. 同聚集索引相比,非聚集索引需要更少的存储空间。(×)

三、填空题,把合适内容填在横线上。(每空1,30)

1. 数据库处理技术依次经历了人工管理、(文件管理)、(数据库管理)、以及分布式数据库管理等四个发展阶段。、

2.关系数据模型包括(关系数据结构)、(关系完整性规则)和关系运算三个方面。

3.学生关系中的班级号属性与班级关系中的班级号主码属性相对应,则(班级号)属性为(学生)关系中的外码。

4.一个关系若存在(部分)函数依赖和(传递)函数依赖,则必然会造成数据冗余和操作异常。

5.在新版的SQL中,查询所涉及到的表及表之间的连接是在from选项中实现的,表之间的连接共有三种方式,分别称为中间连接、(左连接)和(右连接)。

6Access中的表间关系有11、(1对多)和(多对多)三种。

7.一个Access数据库对应于操作系统中的(1)个文件,其文件扩展名为(mdb)。

8.查询可以作为(窗体)(报表)和数据访问页的数据源。

9.报表由(报表页眉)、(页面页眉)、主体、页面页脚和报表页脚等5节组成。

10. (宏)是由一条或多条操作命令组成的集合,其中每条命令用来实现相应的功能。使用(条件表达式)可以确定按条件执行宏。

11. SQL Server 2000中的整数类型包括bigint、(smallint)、(int)和tinyint 四种。

12. SQL Server 2000主要通过(查询分析器)和(企业管理器)这两种工具来完成数据库的管理工作。

13. 当指定基本表中某一列或若干列为主码时,则系统将在这些列上自动建立一个(唯一值或单值)、(聚集)和非空的索引。

14. 定义局部变量的语句关键字为(DECLARE),被定义的各变量之间必须用(逗号)字符分开。

15. 每个存储过程可以包含(多或若干)条Transact-SQL语句,可以在过程体中的任何地方使用(RETURN或返回)语句结束过程的执行,返回到调用语句后的位置。

四、根据主教材第四章所给的商品库和教学库,按照下列前三小题的每条SQL查询语句写出相应的功能,或者按照下列后两小题的每种功能写出相应的SQL查询语句。(每小题4分,共20分)

在名称为商品库的数据库中包含有商品表1和商品表2,它们的定义分别为:

商品表1(商品代号 char(8),分类名 char(8),单价 float,数量 int)

商品表2(商品代号 char(8),产地 char(6),品牌 char(6),)

在名称为教学库的数据库中包含有学生、课程和选课三个表,它们的定义分别为:

学生(学生号 char(7),姓名 char(6),性别 char(2),出生日期 datetime,

专业 char(10),年级 int)

课程(课程号 char(4),课程名 char(10),课程学分 int

选课(学生号 char(7),课程号 char(4),成绩 int)

1select distinct x.*

from 学生 x, 选课 y

where x.学生号=y.学生号

答:从教学库中查询出选修了课程的所有学生信息。

2select *

from 学生

where exists (select *

from 选课

where 学生.学生号=选课.学生号

group by 选课.学生号 having count(*)=3

)

答:从教学库中查询出同时选修了3门课程的全部学生信息。

3select x.*,课程名,课程学分,成绩

from 学生 x,课程 y,选课 z

where x.学生号=z.学生号 and y.课程号=z.课程号

order by x.学生号,z.成绩

答:从教学库中查询出每个学生选课的全部情况,并依次按学生号和成绩排序。

4.从商品库中查询出每种商品的商品代号、单价、数量和产地。

答: select 商品表1.商品代号,单价,数量,产地

from 商品表1,商品表2

where 商品表1.商品代号=商品表2.商品代号

5.从教学库中查询出每门课程被选修的学生人数,并按所选人数的升序排列出课程号、课程名和选课人数。

答: select 课程.课程号,课程名,count(课程.课程号) as 人数

from 课程,选课

where 课程.课程号=选课.课程号

group by 课程.课程号,课程名

order by 人数

五、根据下面所给的AAA数据库,写出每小题所能实现的功能。(每小题5分,共10分)

假设使用名称为AAA的数据库,它包括Students学号 char(8),姓名 varchar(8),年龄 int,专业 varchar(20),入学日期 DateTime)和Score学号 char(8)课程名 varchar(10),成绩 numeric(5,2))两张表。

1. declare @a numeric(5,2),@b numeric(5,2)

set @a=(select max(成绩) from score)

set @b=(select min(成绩) from score)

print @a-@b

答:求出score表中最高成绩与最低成绩的分数之差。

2. create procedure xxk2

as

begin

select x.学号,x.姓名,x.专业,count(*) as 门数

from students x,score y

where x.学号=y.学号

group by x.学号,x.姓名,x.专业

end

答:显示出AAA库中每个学生的学号、姓名、专业等信息及选课门数。

训练第二套

一、单项选择题,把合适的选项编号填写在括号内。(每小题2,20)

1.设D1,D2D3域的基数分别为2,34,则D1D2D3的元组数为(B)。

A. 9 B. 24 C. 10 D. 20

2.若一个关系为R(学生号,姓名,性别,年龄),则(A)适合作为该关系的主码。

A. 学生号 B. 姓名 C. 性别 D. 年龄

3.设一个集合A={3,4,5,6,7},集合B={1,3,5,7,9},则AB的并集中包含有(C)个元素。

A. 10 B. 8 C. 7 D. 6

4. 在一个关系R中,若存在X(Y,Z),则也隐含存在XYXZ,称此为函数依赖的(B)规则。

A. 传递性 B. 分解性 C. 合并性 D. 增广性

5.在SQL的查询语句中,order by选项实现对结果表的(D)功能。

A. 分组统计 B. 求和 C. 查找 D. 排序

6Access2000数据库文件的扩展名是(D)。

Adbf Bdbt Cmdf Dmdb

7.在下面所给的属性中,(D)属性适宜作为主关键字。

A.基本工资 B.职称 C.姓名 D.身份证号码

8.下列(C)图标是Access中表对象的标志。

A B C D

9Access中包含有(B)种数据类型。

A9 B10 C7 D8

10.可以通过Internet进行数据发布的对象是(D)。

A.窗体 B.报表 C.查询 D.数据访问页

二、是非判断题,若叙述正确则在题目后括号内打“√”否则打“×”(每小题2,20)

1.在文件管理阶段程序和数据在存储位置上是分开存放的。(√)

2.若一个关系的一些非主属性可能部分依赖于候选码,则称该关系达到了第二范式。(×)

3.在SQL中建立和删除数据库模式的命令分别为create schemadrop schema。(√)

4.对于较复杂的系统,概念设计阶段的主要任务是:首先根据系统的各个局部应用画出各自对应的局部ER图,然后再进行综合和整体设计,画出整体ER图。(√)

5.由概念设计进入逻辑设计时,原来的实体不需要转换成对应的基本表或视图。(×)

6.机器实现阶段的任务是在计算机系统中建立数据库模式,装入数据,并针对各种处理要求编写出相应的应用程序。(√)

7. 常见的SQL Server2000的版本只包括标准版、个人版、开发版和评估版。(×)

8. 数据库备份和恢复的Transact-SQL语句分别对应为Restore DatabasBackup Database。(×)

9. SQL Server 2000中引入索引主要是为了加速查询速度,并可以保证数据的惟一性。(√)

10. 对于记录较少的基本表,或者需要频繁更新的基本表应尽量创建索引。(×)

三、填空题,把合适内容填在横线上。(每空1,30)

1.在(文件)系统中,数据没有独立的操作界面,在(数据库)系统中,数据具有独立的操作界面。

2. 关系数据库系统具有(数据结构)单一、采用(集合运算)、数据完全独立、数学理论支持等优点。

3.在数据库体系结构中,两级数据映象分别是指(外模式和模式)之间的数据映象以及(模式和内模式)之间的数据映象。

4. 设一个关系为R(A,B,C,D,E,F,G),它的最小函数依赖集为FD={AB,CD,BE,EF},则该关系的候选码为(A,C,G),该候选码含有(3)属性。

5.在SQL中,主码约束的关键字为(primary key),外码约束的关键字为(foreign key)。

6Access2000的用户操作界面由(标题栏)、(菜单栏)、工作区、工具栏、状态栏等五个部分组成。

7.在Access数据库系统中,定义表中的字段就是确定表的结构,即确定表中字段的(名称)、(类型)、属性和说明等内容。

8.查询可以作为(窗体)、(报表)和数据访问页的数据源。

9 Access为用户提供了多种数据库安全措施,包括设置用户(密码)和(权限)。

10.模块窗口中的代码编辑窗口由(对象列表框)、(代码编辑区)和过程事件列表框等三部分组成。

11. SQL Server 2000支持两种形式的变量,即(局部)变量和(全局或系统)变量。

12. SQL Server 2000中,每个程序块的开始标记为关键字(BEGIN),结束标记为关键字(END)。

13. 打开和关闭游标的语句关键字分别为(OPEN)和(CLOSE)。

14. 建立一个存储过程的语句关键字为(CREATE PROC),执行一个存储过程的语句关键字为(EXEC)。

15. SQL Server2000中,通常不需要用户建立索引,而是通过使用(主码)约束和(唯一值或单值)约束,由系统自动建立索引。

四、根据主教材第四章所给的商品库和教学库,按照下列前三小题的每条SQL查询语句写出相应的功能,或者按照下列后两小题的每种功能写出相应的SQL查询语句。(每小题4分,共20分)

在名称为商品库的数据库中包含有商品表1和商品表2,它们的定义分别为:

商品表1(商品代号 char(8),分类名 char(8),单价 float,数量 int)

商品表2(商品代号 char(8),产地 char(6),品牌 char(6),)

在名称为教学库的数据库中包含有学生、课程和选课三个表,它们的定义分别为:

学生(学生号 char(7),姓名 char(6),性别 char(2),出生日期 datetime,

专业 char(10),年级 int)

课程(课程号 char(4),课程名 char(10),课程学分 int

选课(学生号 char(7),课程号 char(4),成绩 int)

1select x.商品代号,分类名,数量,品牌

from 商品表1 x,商品表2 y

where x.商品代号=y.商品代号

答:从商品库中查询出每一种商品的商品代号、分类名、数量和品牌等信息。

2select *

from 学生

where 学生号 in (select 学生号

from 选课

group by 学生号 having count(*)=2)

答:从教学库中查询出选修2门课程的全部学生。

3select x.学生号,y.学生号,y.课程号

from 选课 x,选课 y

where x.学生号=@s1 and y.学生号=@s2

and x.课程号=y.课程号

答:从教学库中查询出学生号为@s1的学生和学生号为@s2的学生所选修的共同课程的课程号。

4.从商品库中查询出数量大于10的商品种数。

答: select count(*)

from 商品表1

where 数量>10

5.从商品库中查询出比所有商品单价的平均值要高的全部商品。

答:select *

from 商品表1

where 单价>all(select avg(单价)

from 商品表1)

五、根据下面所给的AAA数据库,写出每小题所能实现的功能。(每小题5分,共10分)

假设使用名称为AAA的数据库,它包括Students学号 char(8),姓名 varchar(8),年龄 int,专业 varchar(20),入学日期 DateTime)和Score学号 char(8)课程名 varchar(10),成绩 numeric(5,2))两张表。

1.create procedure xxk3

as

begin

select 学号,avg(成绩) as 平均成绩

from score

group by 学号

end

答:显示出AAA库中每个学生的平均成绩。

2. declare @a char(8)

set @a='计算机'

select 计算机专业人数=count(*)

from students

where left(专业,3)=@a

答:从students表中统计出专业名开头为@a的值(即“计算机”)的所有学生人数。

训练第三套

一、单项选择题,把合适的选项编号填写在括号内。(每小题2,20)

1.设一个关系A具有a1个属性和a2个元组,关系B具有b1个属性和b2个元组,则关系AB具有(B)个元组。

A. a1+b1 B. a2b2 C. a1+b2 D. a2b1

2.在一个关系R中,若X能够函数决定关系R中的每个属性,并且X的任何真子集都不能函数决定R中的每个属性,则称X为关系R的一个(A)。

A. 候选码 B. 外码 C. 超码 D. 属性组

3. 在一个关系R中,若存在X(Y,Z),则也隐含存在XYXZ,称此为函数依赖的(B)规则。

A. 传递性 B. 分解性 C. 合并性 D. 增广性

4.设一个关系为R(A,B,C,D,E),它的最小函数依赖集为FD={AB,CD,CE},该关系只满足第一范式,若要规范化为第二范式,则将被分解为(C)个关系。

A. 1 B. 2 C. 3 D. 4

5.由概念设计进入逻辑设计时,原来的(C)联系通常都需要转换成对应的基本表。

A. 一对一 B. 一对多 C. 多对多 D. 多对一

6ACCESS 2000数据库文件中至少包含有(A)对象。

A.表 B.查询 C.窗体 D.模块

7.如果字段内容为声音文件,可将此字段定义为(C)类型。

A.文本 B.查询向导 COLE对象 D.备注

8.下列(D)是主键的标志。

A B C D

9Access中字段的“小数位”属性被用来指定(A)型数据的小数部分的位数。

A.货币和数字 B.货币和备注

C.文本和数字 D.数字和备注

10.创建数据访问页,将生成一个单独的(A)文件,此文件不包括在Access2000数据库中。

AHTML BMDB CMDF DMDT

二、是非判断题,根据叙述正确与否在题目开始的括号内打对号“√”或叉号“×”(每小题2,20)

(√)1.在人工管理和文件管理阶段,程序设计依赖于数据表示。

(√)2.在一个关系中,不同的列可以对应同一个域,但必须具有不同的列名。

(√)3.设一个学生关系为S(学生号,姓名),课程关系为C(课程号,课程名),选课关系为X(学生号,课程号,成绩),则姓名为变量K的值的学生所选修的全部课程信息所对应的运算表达式为C 课程号(X (δ姓名=K(S)))。

(×)4.若一个关系的任何非主属性都不部分依赖和传递依赖于任何候选码,则该关系还没有达到第三范式。

(√)5. SQL中,每个视图中的列可以来自不同的表,每个视图是在原有表的基础上建立的逻辑意义上的新关系。

(×)6. SQL Server 2000中,主数据文件、次数据文件和事务日志文件的默认扩展名依次为ldfndfmdf

(√)7. 定义为varchar数据类型的字段或变量能够自动去掉尾部空格以节省存储空间。

(×)8. 在一个已存在数据的表中增加一列时,可以把所增加的列定义为非空值。

(×)9. SQL Server2000数据库应用的处理过程只需要在服务器上进行。

(√)10. 一个局部变量的作用范围局限于一个批处理内,即两个GO语句之间的那一部分。

三、填空题,把合适内容填在横线上。(每空1,30)

1.实体之间的联系类型有三种,分别为11、(1对多)和(多对多)。

2.数据库系统的三级模式结构和两级数据映象确保了数据的(逻辑)独立性和(物理)独立性。

3.在候选码中的每个属性被称为(主)属性,不在任何候选码中的每个属性被称为(非主)属性。

4. SQL中,单值约束的关键字为(unique),检查约束的关键字为(check)。

5.一个数据库应用系统的开发过程大致相继经过(需求分析)、(概念设计)、逻辑设计、物理设计、机器实现、运行维护等六个阶段。

6Access2000数据库包含有(表)、(查询)、窗体、报表、页、宏、模块等7种数据库对象。

7.在Access2000的表结构设计窗口中,其上半部分的“表设计器”是由(字段名称)、(数据类型)和说明等三列所组成。

8.在Access2000中,模块被分为(类模块)和(标准模块)两种类型。

9.在Access2000中,标准模块包含的两种过程是(通用过程)和(常用过程)。

10. SQL Server2000版本一般包括企业版、(标准版)、(个人版)、开发版和评估版等。

11. SQL Server2000中的数据类型主要包括数值、(字符)、(日期时间)、二进制、位和双字节等类型。

12. 索引可以由系统根据约束条件自动建立,也可以由用户通过命令或菜单方式建立,但它的(打开)、(重建)和关闭将根据需要由系统自动实现,无须用户过问。

13. 在一个存储过程定义的AS关键字前可以定义该过程的(参数),AS关键字之后为该过程的(过程体)。

14. 索引的存在会减慢对基本表的(插入)、(删除)和修改等操作的速度。

15. 要访问SQL Server2000数据库服务器,用户必须提供正确的(登录帐号)和(口令)。

四、根据主教材第四章所给的商品库和教学库,按照下列前三小题的每条SQL查询语句写出相应的功能,或者按照下列后两小题的每种功能写出相应的SQL查询语句。(每小题4分,共20分)

在名称为商品库的数据库中包含有商品表1和商品表2,它们的定义分别为:

商品表1(商品代号 char(8),分类名 char(8),单价 float,数量 int)

商品表2(商品代号 char(8),产地 char(6),品牌 char(6),)

在名称为教学库的数据库中包含有学生、课程和选课三个表,它们的定义分别为:

学生(学生号 char(7),姓名 char(6),性别 char(2),出生日期 datetime,

专业 char(10),年级 int)

课程(课程号 char(4),课程名 char(10),课程学分 int

选课(学生号 char(7),课程号 char(4),成绩 int)

1select distinct 产地

from 商品表2

答:从商品库中查询出所有商品的不同产地。

2select *

from 课程

where 课程号 in (select 课程号

from 选课

group by 课程号 having count(*)>5)

答:从教学库中查询出被5个以上学生选修的全部课程。

3select *

from 学生

where exists (select *

from 选课

where 学生.学生号=选课.学生号

group by 选课.学生号 having count(*)=3)

答:从教学库中查询出同时选修了3门课程的全部学生。

4.从商品库中查询出数量在1020之间的所有商品。

答:select *

from 商品表1

where 数量 between 10 and 20 (或where 数量>=10 and 数量<=20

5.从商品库中查询出数量最多的一种商品。

答:select *

from 商品表1

where 数量=some(select max(数量)

from 商品表1)

五、根据下面所给的AAA数据库,写出每小题所能实现的功能。(每小题5分,共10分)

假设使用名称为AAA的数据库,它包括Students学号 char(8),姓名 varchar(8),年龄 int,专业 varchar(20),入学日期 DateTime)和Score学号 char(8)课程名 varchar(10),成绩 numeric(5,2))两张表。

1. declare @a char(8)

set @a='计算机'

select count(*) as 计算机专业人数

from students

where left(专业,3)=@a

答:从students表中统计出专业名开头为@a的值(即“计算机”)的所有学生人数。

2.create procedure xxk4

( @a char(8),@b varchar(10),@c numeric(5,2) )

as

begin

update score

set 成绩=@c

where 学号=@a and 课程名=@b

end

答:修改score表中学号为@a的值、课程名为@b的值的学生的成绩为@c的值。

训练第四套

一、单项选择题,把合适的选项编号填写在括号内。(每小题2,20)

1.设一个学生关系为S(学生号,姓名),课程关系为C(课程号,课程名),选课关系为X(学生号,课程号,成绩),则至少选修了课程号为’001’’002’课程的全部学生信息所对应的运算表达式为( Π学生号(δ课程号=’001’ 课程号=’002’(X))。(C

A. X B. C C. S D. Π学生号(S)

2. 设一个关系为R(A,B,C,D,E),它的最小函数依赖集为FD={AB,BC,BD,DE},则该关系的候选码为(A)。

A. A B. B C. C D. D

3.在SQL的查询语句中,group by选项实现(D)功能。

A. 排序 B. 求和 C. 查找 D. 分组统计

4.设一个集合A={3,4,5,6,7},集合B={1,3,5,7,9},则AB的差集中包含有(D)个元素。

A. 10 B. 5 C. 3 D. 2

5.在SQL中,alter table为(B)数据库中基本表结构的命令。

A. 建立 B. 修改 C. 删除 D. 查询

6.如果某一字段数据类型为文本型,字段大小为8,该字段中最多可输入(B)个汉字。

A8 B4 C16 D32

7.创建表之间的关系时,正确的操作是(B)。

A.关闭当前打开的表 B.打开要建立关系的表

C.关闭所有打开的表 D.关闭与之无关的表

8Access是(A)办公套件中的一个重要组成部分。

AOffice BWord CExcel DLotus

9.下列(D)图标是Access中新建报表的标志。

A B

C D

10.下列(B)图标是Access中模块对象的标志。

A B C D

二、是非判断题,根据叙述正确与否在题目开始的括号内打对号“√”或叉号“×”(每小题2,20)

(×)1DBMS只提供数据定义语句,不提供数据操纵语句供用户使用。

(×)2.在一个关系R中,若XY,并且X的任何真子集都不能函数决定Y,则称XY为部分函数依赖,

(√)3.基本表属于全局模式中的表,它是实表,而视图则属于局部模式中的表,它是虚表。

(×)4.当修改一个视图时,不会对相应的基本表产生任何影响。

(√)5. 当指定基本表中某一列或若干列为UNIQUE约束时,则系统将在这些列上自动建立一个唯一值索引。

(√)6. SQL Server2000数据库应用的处理过程分布在客户机和服务器上。

(×)7. 安装SQL Server2000时,不必以系统管理员的身份登录操作系统。

(√)8. SQL Server2000datetimesmalldatetime数据类型主要用来存储日期和时间的组合数据。

(×)9. 索引一经创建既可以由SQL Server2000系统又可以由用户使用和维护。

(√)10. 触发器是一种特殊的存储过程,它可以在对一个表进行插入、删除或修改操作时被自动调用执行。

三、填空题,把合适内容填在横线上。(每空1,30)

1.在文件系统中,存取数据的基本单位为(记录),在数据库系统中,存取数据的基本单位为(数据项)。

2.数据库的逻辑数据模型依次有层次、网状、(关系)和(对象)等四种。

3.数据库体系结构中包含的三级模式为(全局模式)、(外模式)和内模式三种。

4.设一个关系为R(A,B,C,D,E),它的最小函数依赖集为FD={AB,AC,AD,DE},该关系满足(第二)范式,若要规范化为高一级的范式,则将得到(2)个关系。

5.在SQL中,根据基本表建立一个视图时,包括建立了该视图的(结构)和(内容)两个方面。

6Access2000“表”结构设计窗口分为两半部分,上半部分是(表设计器),下半部分是(字段属性)。

7.在Access2000中,“货币”型数据最长为(8)个字节,“自动编号”型数据最长为(4)个字节。

8.在Access 2000报表中有(设计)和(预览)视图,而没有数据表视图。

9.模块窗口由(工程资源)管理器、(模块属性)窗口和代码编辑窗口三部分组成。

10Access2000中的窗体由(页眉)、(主体)和页脚等三个部分组成。

11. SQL Server2000提供的最常用的管理工具是(企业管理器)和(查询分析器)。

12. SQL Server2000中,前后相邻的语句之间可以使用(空格)、(分号)或回车换行符分开。

13. SQL Server2000中,为局部变量赋值的语句是(SELECT)和(SET)。

14. 对表中记录的维护主要有增加、(删除)、(修改)操作。

15. 数据库的安全管理问题归结为对(琐)和(钥匙)的管理问题。

四、根据主教材第四章所给的商品库和教学库,按照下列前三小题的每条SQL查询语句写出相应的功能,或者按照下列后两小题的每种功能写出相应的SQL查询语句。(每小题4分,共20分)

在名称为商品库的数据库中包含有商品表1和商品表2,它们的定义分别为:

商品表1(商品代号 char(8),分类名 char(8),单价 float,数量 int)

商品表2(商品代号 char(8),产地 char(6),品牌 char(6),)

在名称为教学库的数据库中包含有学生、课程和选课三个表,它们的定义分别为:

学生(学生号 char(7),姓名 char(6),性别 char(2),出生日期 datetime,

专业 char(10),年级 int)

课程(课程号 char(4),课程名 char(10),课程学分 int

选课(学生号 char(7),课程号 char(4),成绩 int)

1select distinct 品牌

from 商品表2

答:从商品库中查询出所有商品的不同品牌。

2select x.学生号,y.学生号,y.课程号

from 选课 x,选课 y

where x.学生号=@s1 and y.学生号=@s2

and x.课程号=y.课程号

答:从教学库中查询出学生号为@s1的学生和学生号为@s2的学生所选修的共同课程的课程号。

3select 专业,count(*) as 专业人数

from 学生

group by 专业

order by 专业人数 desc

答:从教学库中查询出每个专业的学生人数,并按人数多少降序排列。

4.从商品库中查询出每类(即分类名相同)商品的最高单价。

答:select 分类名,max(单价) as 最高单价

from 商品表1

group by 分类名

5.从商品库中查询出同一类商品多于一种的所有分类名。

答:select distinct 分类名

from 商品表1

group by 分类名 having count(*)>1

五、根据下面所给的AAA数据库,写出每小题所能实现的功能。(每小题5分,共10分)

假设使用名称为AAA的数据库,它包括Students学号 char(8),姓名 varchar(8),年龄 int,专业 varchar(20),入学日期 DateTime)和Score学号 char(8)课程名 varchar(10),成绩 numeric(5,2))两张表。

1. select year(入学日期) as 入学年份,count(*) as 人数

from students

group by year(入学日期)

答:从Students表中分组统计出每个年份入学的学生人数。

2. declare @a numeric(5,2)

set @a=(select avg(成绩) from score)

select *

from score

where 成绩>=@a

答:从Score表中查询出大于等于平均成绩的所有记录。

训练第五套

一、单项选择题,把合适的选项编号填写在括号内。(每小题2,20)

1.设D1D2D3域的基数分别为234,则D1D2D3的元组数为(B)。

A. 9 B. 24 C. 10 D. 20

2.若一个关系为R(学生号,姓名,性别,年龄),则(A)最适合作为该关系的主码。

A. 学生号 B. 姓名 C. 性别 D. 年龄

3.设一个集合A={3,4,5,6},集合B={1,3,5,7},则AB的并集中包含有(D)个元素。

A. 10 B. 8 C. 7 D. 6

4. 在一个关系R中,若存在X(Y,Z),则也隐含存在XYXZ,称此为函数依赖的(B)规则。

A. 传递性 B. 分解性 C. 合并性 D. 增广性

5.在SQL的查询语句中,order by选项实现对结果表的(D)功能。

A. 分组统计 B. 求和 C. 查找 D. 排序

6Access2000数据库文件的扩展名是(C)。

Adbf Bdbt Cmdb Dmdf

7.在Access系统中,对数据表的查询操作共分为(B)种情况。

A8 B5 C3 D2

8.下列(C)图标是Access中表对象的标志。

A B C D

9Access2000系统中包含有(A)种数据类型。

A10 B9 C8 D7

10.可以通过Internet进行数据发布的操作对象是(D)。

A.窗体 B.报表 C.查询 D.数据访问页

二、是非判断题,根据叙述正确与否在题目开始的括号内打对号“√”或叉号“×”(每小题2,20)

(√)1.在文件系统中,不容易做到数据共享,而在数据库系统中,容易做到数据共享。

(√)2.在一个关系R中,若属性集X函数决定属性集Y,则记作为XY,称X为决定因素。

(×)3 已知“职工号→性别”成立,则“(职工号,性别)→性别”是平凡函数依赖,但不是部分函数依赖。

(√)4.在SQL中,通过使用视图,能够使在关系规范化时被分解的关系重新连接起来,能够增强数据库的安全性。

(×)5.需求分析阶段的主要目标是画出数据流图和建立数据字典,不需要编写需求说明书。

(√)6.在进行系统调试时,要有意地使用各种不同的数据和进行各种不同的操作,去测试系统中的所有方面。

(×)7. SQL Server2000中,不适合使用bit数据类型来表示逻辑数据。

(×)8. SQL Server2000中,利用聚集索引比非聚集索引的查询速度要慢。

(×)9. SQL Server2000中,多行注释的开始标记为“/*”,结束标记也为“/*”。

(√)10. SQL Server2000中,CASE结构是一个函数,只能作为一个表达式使用在另一个语句中。

三、填空题,把合适内容填在横线上。(每空1,30)

1.任一种数据模型都有(型)和(值)的区别。

2. 关系数据库系统具有(数据结构)单一、采用(集合运算)、数据完全独立、数学理论支持等优点。

3.设一个关系为R(A,B,C,D,E),它的最小函数依赖集为FD={AB,AC,(A,D)E},则该关系的候选码为(A,D),该关系存在着(部分)函数依赖。

4.在SQL中,(主码)约束的关键字为primary key,(外码)约束的关键字为foreign key

5.在新版的SQL中,表之间的连接共有三种方式,对应的关键字分别为(inner join)、(left join)和right join

6SQL是高度(非过程化)和面向(集合)操作的语言。

7.实体之间的联系类型有三种,分别为(11)、(1对多)和多对多。

8.数据库系统的(三)级模式结构和(两)级数据映象确保了数据的逻辑独立性和物理独立性。

9.向基本表中插入数据有两种命令方式,一种称为(单值)插入方式,另一种称为(多值)插入方式。

10. SQL中,约束的关键字为(单值)unique,(检查)约束的关键字为check

11Access2000数据库包含有(表)、(查询)、窗体、报表、页、宏、模块等7种数据库操作对象。

12.在Access2000的表结构设计窗口中,其上半部分的“表设计器”是由字段(名称)、数据(类型)和说明等三列所组成。

13.在Access2000中,模块被分为(类模块)和(标准模块)两种类型。

14.在Access2000中,标准模块包含的两种过程是(通用过程)和(常用过程)。

15. Access2000中,报表窗口由(5)个部分组成,每个部分称为一个(节)。

四、根据主教材第四章所给的商品库和教学库,按照下列前3小题的每条SQL查询语句写出相应的功能,接着按照下列后2小题的每种功能写出相应的SQL查询语句。(每小题4分,共20分)

在名称为商品库的数据库中包含有商品表1和商品表2,它们的定义分别为:

商品表1(商品代号 char(8),分类名 char(8),单价 float,数量 int)

商品表2(商品代号 char(8),产地 char(6),品牌 char(6),)

在名称为教学库的数据库中包含有学生、课程和选课三个表,它们的定义分别为:

学生(学生号 char(7),姓名 char(6),性别 char(2),出生日期 datetime,

专业 char(10),年级 int)

课程(课程号 char(4),课程名 char(10),课程学分 int

选课(学生号 char(7),课程号 char(4),成绩 int)

1select 课程.课程号,课程.课程名,count(*) as 选课人数

from 课程,选课

where 课程.课程号=选课.课程号

group by 课程.课程号,课程.课程名

答:从教学库中查询出每门课程被选修的学生数。

2select *

from 课程

where exists (select 课程号

from 选课

where 课程.课程号=选课.课程号

group by 课程号 having count(*)>=3 )

答:从教学库中查询出至少被3名学生选修的所有课程。

3select x.*,课程名,课程学分,成绩

from 学生 x,课程 y,选课 z

where x.学生号=z.学生号 and y.课程号=z.课程号

order by x.学生号,z.成绩

答:从教学库中查询出每个学生选课的全部情况,并依次按学生号和成绩排序。

4.从商品库中查询出每种商品的商品代号、单价、数量和产地。

答:select 商品表1.商品代号,单价,数量,产地

from 商品表1,商品表2

where 商品表1.商品代号=商品表2.商品代号

5.从商品库中查询出数量值最大的商品记录。

答:select *

from 商品表1

where 数量=some(select max(数量) from 商品表1)

//或者where 数量>=all(select 数量 from 商品表1)

五、根据下面所给的AAA数据库,写出每小题所能实现的功能。(每小题5分,共10分)

假设使用名称为AAA的数据库,它包括Students学号 char(8),姓名 varchar(8),年龄 int,专业 varchar(20),入学日期 DateTime)和Score学号 char(8)课程名 varchar(10),成绩 numeric(5,2))两张表。

1. create procedure xxk1

as

begin

select *

from students x,score y

where x.学号=y.学号

end

答:显示出AAA库中所有学生的记录信息及选课成绩。

2. create procedure xxk6

( @a char(8),@b varchar(10) )

as

begin

delete from score

where 学号=@a and 课程名=@b

end

答:从score表中删除学号为@a的值、课程名为@b的值的学生成绩记录。


请您删除一下内容,O(∩_∩)O谢谢!!!2015年中央电大期末复习考试小抄大全,电大期末考试必备小抄,电大考试必过小抄Many people have the same mixed feelings when planning a trip during Golden Week. With heaps of time, the seven-day Chinese请您删除一下内容,O(∩_∩)O谢谢!!!National Day holiday could be the best occasion to enjoy a destination. However, it can also be the easiest way to ruin how you feel about a place and you may become more fatigued after the holiday, due to battling the large crowds. During peak season, a dream about a place can turn to nightmare without careful planning, especially if you travel with children and older people. As most Chinese people will take the holiday to visit domestic tourist destinations, crowds and busy traffic are inevitable at most places. Also to be expected are increasing transport and accommodation prices, with the possibility that there will be no rooms available. It is also common that you' ll wait in the line for one hour to get a ticket, and another two hours at the site, to only see a tiny bit of the place due to the crowds. Last year, 428 million tourists traveled in China over the week-long holiday in October. Traveling during this period is a matter that needs thorough preparation. If you are short on time to plan the upcoming "Golden Week" it may not be a bad idea to avoid some of the most crowded places for now. There is always a place so fascinating that everyone yearns for. Arxan is a place like this. The beauty of Arxan is everlasting regardless of the changing of four seasons. Bestowed by nature, its spectacular seasonal landscape and mountains are just beyond word. Arxan is a crucial destination for the recommended travelling route, "China Inner Mongolia Arxan — Hailar — Manzhouli". It is also the joint of the four prairies across the Sino-Mongolian border, where people gravitate towards the exotic atmosphere mixed with Chinese, Russian, and Mongolia elements. As a historic site for the Yitian Battle, Arxan still embodies the spirit of Genghis Khan. Walking into Arxan, you will be amazed by a kaleidoscope of gorgeous colors all the year round -- the Spring azaleas blooming red in the snow, the Summer sea wavering blue in the breeze, the Autumn leaves painted in yellow covering volcanic traces, and the Winter woods shining white on the vast alpine snowscape. Hinggan League Arxan city is situated in the far eastern area of Inner Mongolia Autonomous Region. Its full name "Haren Arxan" means "hot holy water" in the Mongolian language. Arxan is a tourism city in the northern frontier with a blend of large forest, grand prairies, vast snowfield, heaven lake cluster, thermium, as well as volcanic cluster. It is a rare and unique ecotourism base filled with healthy sunshine, clean air and unspoiled green.  Nestled close to the country's largest virgin forest, and known for its spring and ecological environment, Arxan is marveled at by many tourists as the purest land on earth.  You cannot miss out the Autumn of Arxan. It is definitely the best with brightly-colored scenery full of emotions.  Autumn in the northern part of the country comes earlier than the South. A September rain followed by the footprints of Autumn brings more colors to the once emerald green mountain and blooming grassland.  Shutterbugs flock to see for themselves the marvel of splendid colors around the mountains and waters, many of whom have travel a long distance and even camp here only to capture a moment of the nature wonder.  The silver birch turns golden, while the larch is still proudly green. You will find yourself drowned in the intoxicating red of the wild fruits as well as the glamour of flowers in full blown. And your heart will be lingering on the woods as it's time for the wild fruits to ripe. The picturesque Arxan in Autumn is indeed a fairyland only exists in a dream that satisfies all your fantasies. If it rains heavily on Saturday night, some elderly Chinese will say it is because Zhinu, or the Weaving Maid, is crying on the day she met her husband Niulang, or the Cowherd, on the Milky Way. Most Chinese remember being told this romantic tragedy when they were children on Qixi, or the Seventh Night Festival, which falls on the seventh day of the seventh lunar month, which is usually in early August. This year it falls on Saturday, August 2. Folklore Story As the story goes, once there was a cowherd, Niulang, who lived with his elder brother and sister-in-law. But she disliked and abused him, and the boy was forced to leave home with only an old cow for company. The cow, however, was a former god who had violated imperial rules and was sent to earth in bovine form. One day the cow led Niulang to a lake where fairies took a bath on earth. Among them was Zhinu, the most beautiful fairy and a skilled seamstress. The two fell in love at first sight and were soon married. They had a son and daughter and their happy life was held up as an example for hundreds of years in China. Yet in the eyes of the Jade Emperor, the Supreme Deity in Taoism, marriage between a mortal and fairy was strictly forbidden. He ordered the heaven troop to catch Zhinu back. Niulang grew desperate when he discovered Zhinu had been taken back to heaven. Driven by Niulang's misery, the cow told him to turn its hide into a pair of shoes after it died. The magic shoes whisked Niulang, who carried his two children in baskets strung from a shoulder pole, off on a chase after the empress. The pursuit enraged the empress, who took her hairpin and slashed it across the sky creating the Milky Way which separated husband from wife. But all was not lost as magpies, moved by their love and devotion, formed a bridge across the Milky Way to reunite the family. Even the Jade Emperor was touched, and allowed Niulang and Zhinu to meet once a year on the seventh night of the seventh month. This is how Qixi came to be. The festival can be traced back to the Han Dynasty (206 BC-AD 220). Traditionally, people would look up at the sky and find a bright star in the constellation Aquila as well as the star Vega, which are identified as Niulang and Zhinu. The two stars shine on opposite sides of the Milky Way. Customs In bygone days, Qixi was not only a special day for lovers, but also for girls. It is also known as the "Begging for Skills Festival" or "Daughters' Festival." In this day, girls will throw a sewing needle into a bowl full of water on the night of Qixi as a test of embroidery skills. If the needle floats on top of the water instead of sinking, it proves the girl is a skilled embroiders. Single women also pray for finding a good husband in the future. And the newly married women pray to become pregnant quickly. Tradition transformed The love story of Niulang and Zhinu, and the Qixi Festival have been handed down for generations. Yet these ancient traditions and customs are slowly dying out. Many modern Chinese, particularly youngsters, seem to know more about St Valentine's Day on February 14, characterized by bouquets of roses, chocolates and romantic candlelight dinners, than they do about their home-grown day for lovers. Even Qixi is nowadays referred to as the "Chinese Valentine's Day." More and more young Chinese people begin to celebrate this day in a very similar way as that in western countries. Fewer people than ever will gaze at the heavens on Saturday to pick out the two stars shining bright on either side of the Milky Way, that is, if people even know on which day Qixi falls. There are ready reminders dotted about, in the form of big ads saying "Sales on Chinese Valentine's Day!" in shops, hotels and restaurants. But few young women will mark the festival with their boyfriends, or take part in traditional activities to pray for cleverness. A large-scale of exhibition on the Silk Road opened to the public in the National Museum on Thursday. The exhibition displays more than 400 treasures from Shaanxi province, Gansu province and 14 other regions. It is largest scale exhibition that shows the history of the Silk Road in recent years. As APEC is going on in Beijing, the exhibit aims to show the world this brilliant section of history. The Silk Road is a series of trade and cultural transmission routes that were central to cultural interaction through regions of the Asian continent. It connected the West and East by linking traders, merchants, pilgrims, monks, soldiers, nomads, and urban dwellers from China and India to the Mediterranean Sea during various periods of time. I met my dear hubby in 2009 the second year I was in my school and it was the first year when he came here. We became colleagues. And there was nothing special happening during that year. He was just a kind and humble brother graduated from the same college as me. But we did not know each other till he became my colleague and his office desk was just in front of me. There was only a glass between us. So actually we could see each other when we both look up. But it is not the main reason that really draws us close. How we become close to each other was something seems quite natural. We went out to play badminton with other colleagues and we sometimes chatted for a while. He is a man of few words but somehow sometimes will say something really humorous. Then one day, to my great surprise, I found a pot of beautiful flower on my desk. It was just the flower I had talked about with my colleague the other day, and I thought it was her who put the flower there. But the truth is not. It was the humble guy sitting in front of me. He just simply said ,”well, I caught sight of this flower and thought that it’s beautiful and you may like it”. I wonder why I was moved because of these simple words and present. Maybe it is the sincerity and the true self that impress me. I thanked him and some colleagues walked past my desk would appreciate the beautiful flower and they noticed that something romance happened there. Then later on, there were some little surprises once in a while. Once, there was something wrong with my drawer and I had complained about it unconsciously. And he fixed it for me. Then the other day, he placed several pink diamond roses beside the flower with a piece of paper saying” I love you more than I can say! Diamond stands for marriage, rose stand for love. I hope you are mine, become my wife. You are the only girl who I really want to spend the rest of my life to stand by.” Although there were some grammar errors but I got what he meant. He meant so clear and so direct.  And actually, I accepted him some days earlier. I was just waiting for him to break the ice. So finally, the common interests and the common understanding brought us together. Some people say the relationship and the feeling will change after getting hitched. You will find that love is no longer strong and there is always lack of passion and what’s worse you may find out many bad habits of your partner, which never appear when you are first in love before the marriage. It seems that many faults turn up after you truly living together and see each other’s face the moment you open your eyes in the early morning. But after almost 4 years from now, I do not feel any negative change in our relationship. During all these years, we know each other better and we become more tolerant about each other and I realize that if you really love a person you will accept his imperfect. And what is the qualification of a good husband? Once I was chatting with my colleague about this issue. And one of the qualifications I thought was that he must be a good cook. But to my surprise, my colleague said that a good husband must be someone who makes big money. What made her think so was quite beyond me. Maybe I am not sophisticated enough and what I want is just simple life style. The most enjoyable thing is that we go to the market to buy vegetables and other daily stuffs if we both have time. Maybe he is a housebound husband and I love housebound man. And there is another reason why We love going to the market. That is because we sometimes will get some surprises. The surprise is saving little fish which are disserted by the fish mongers. Because these fish are swellfish. Then we will collect them and set them free into the river. Swellfish are lovely creature. When they look like a little submarine when they are swimming in the water and look like a meat ball when you hold them in your hand. And if they are scared, they will swell and look like a little ball. Every time we see them swim away and we feel their happiness of returning home and this also make us cherish life. Maybe some will consider these behavior as something childish. Well, that is fine with us. We love doing these together and feel happy that is what it is all about. My dear hubby is a kind hearted man and he love animals just as I do. I am lucky to have someone who can be both my intimated soul mate and my forever friend.

2019年整理电大考试复习资料电大专科《数据库基础与应用》期末复习试题及参考答案资料

相关推荐