数据库考试题及答案

  • 格式:docx
  • 大小:34.04 KB
  • 文档页数:53

下载文档原格式

  / 50
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

习题

一、[12分] 用英文解释

1、DBMS

2、Data Dictionary

3、Transaction二、[10分]

二、单项选择题

1.There may be instances where an attribute has a set of values for a specific entity. This type of attribute is said to be 【】

A.single valued attribute B.multivalued attribute C.simple attribute D.composite attribute

2.In a particular bank, a loan can belong to only one customer, and a customer can have several loans, then the relationship set from customer to loan is【】

A.one to many B.many to many C.many to one D.one to one

3.A【】contains metadata─ that is, data about data. A.table B.view C.data dictionary D.trigger

4.The phrase “greater than at least one” is represented in SQL by【】

A.>all B.some

5.In general, all aggregate functions except 【】ignore

null values in their input collection.

A.sum B.avg C.min D.count

6.If a schedule S can be transformed into a schedule S’by a series of swaps of non-conflicting instructions, we say that S and S’ ar e【】

A.non-conflicting equivalent B.conflict equivalent C.non-conflicting serializable D.conflict serializable 7.The fundamental operations in the relational algebra are【】。

A.∪,-,×,π和σ B.∪,-,∞,π和σ

C.∪,∩,×,π和σ D.∪,∩,∞,π和σ

8.In SQL, =some is identical to in, and【】is identical to not in。

A.<>some B.=all C.<>all D.=some

9.The result of true and null is【】。

A.null B.true C.false D.not null

10.The function sum applied on the collection {1,1,3,4,4,11} returns the value【】.

A.24 B.6 C.4 D.11

三、[10分] 设有Course(课程)、Teacher(教师)、Student(研究生),其中:

1、Course有属性cno(课程号)、cname(课程名)和mark(学分);

2、Teacher有属性tno(教师编号)、tname(教师姓名)和major(专业属性);

3、Student有属性sno(学号)、sname(学生姓名)、age(年龄)、bno(班级号)、score(总成绩)

属性。

4、Teacher与Student之间有指导论文的联系,用Supervise表示,每位教师可指导多名

研究生,每名研究生有且只能有一位指导教师;

5、Teacher与Course之间有讲授的联系,用Teach表示,每位教师可以教授多门课程,

每门课程可同时由多位教师开设。

试画出E-R图。

四、[12分] 题设与第三题相同,试根据你所画的E-R图,设计出关系数据库,并指出每个关

系中的主键和外键。

五、[8分] 题设与第三题相同,试用关系代数表达:

1.检索编号为’t01’的老师的姓名

2.检索班级号为’b01’或者年龄大于21岁所有学生的姓名

六、[12分]题设与第三题相同。使用SQL表达:

1.建立表结构Course(课程)、Teacher(教师)、Student(研究生) (其中要求age大于零;定义必要的主键和外键)。

2.将学号为”a01”,姓名为”zhang”,年龄为”22”的学生信息加

入到Student表中

3.检索专业为’计算机’的老师的姓名和编号, 并按编号由大到小排列。

4.将学号以’a01’开头的学生信息删除。

5.检索比’b01’班所有学生的总成绩都高的学生的姓名,去掉重复的姓名。

6.检索张山老师所教的学生的平均总成绩(假设不存在教师重名现象)。

七、[12分] 设有属于1NF的关系模式R=(A, B, C, D, E),R上的函数依赖集F={ BC✂AD,

AD✂EB,E✂C }。

1. R是否属于3NF?为什么?

2. R是否属于BCNF?为什么?

八、[12分]设有属于1NF的关系模式R=(A, B, C, D, E),R上的函数依赖集F包含如下函数依赖F={AB→C, D→A, E→C, B→CD, B→A}

1、求X=BD关于F的闭包X+.

2、求F的一个正则覆盖.

3、求满足3NF分解的关系模式

九、[12分] 设有如下调度S。

a)判别S是否为冲突可串行化调度?

2. 如果是冲突可串行化调度,则给出与S冲突等价的串行调度。

相关主题