数据库考试题

上传人:博****1 文档编号:560786486 上传时间:2023-04-19 格式:DOC 页数:44 大小:872KB
返回 下载 相关 举报
数据库考试题_第1页
第1页 / 共44页
数据库考试题_第2页
第2页 / 共44页
数据库考试题_第3页
第3页 / 共44页
数据库考试题_第4页
第4页 / 共44页
数据库考试题_第5页
第5页 / 共44页
点击查看更多>>
资源描述

《数据库考试题》由会员分享,可在线阅读,更多相关《数据库考试题(44页珍藏版)》请在金锄头文库上搜索。

1、习题一、12分用英文解释1、DBMS 2、Data Dictionary 3、Transaction10分二、单项选择题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 attributeB. multivalued attributeC. simple attributeD. composite attribute2. In a particular ban

2、k, a loan can belong to only one customer, and a customer can have several loans, the n the relati on ship set fromcustomer to loa n is【】A . one to many B. many to many C. many to one D . one to one3 . A【】contains metadata that is, data about data.A . table B . view C . data dictio nary D . trigger4

3、 . The phrase “greater tha n at least one ” is represented in SQL byA . all B . all C . some5 . In gen eral, all aggregate fun cti ons except【】ignore n ull values in their in put collecti on.A . sum B . avg C . min D . count6 . If a schedule S can be transformed into a schedule S by a series of swap

4、s of non-conflictingin struct ions, we say that S and S 【】 areA . non-con flict ing equivale ntB . con flict equivale ntC . non-co nflicti ng serializableD . con flict serializable7 . The fun dame ntal operati ons in the relati onal algebra ar【】。A. U,-,人 n和(T B. U,-,冗和 cC . U,n,X, n和 c D . U , n,汽冗和

5、 c8 . In SQL, =some is identical to in, and【】is identical to not in。A . some B . =all C . all D . =some9 . The result of true a nd n ull is【】。A . null B. true C. false D. not null10. 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课程)、Te

6、acher教师)、Student(研究生),其中:Course有属性eno(课程号)、cname课程名)和mark(学分);Teacher有属性tno(教师编号)、tname(教师姓名)和major(专业属性);Student有属性sno(学号)、sname学生姓名)、age(年龄)、bno(班级号)、score(总成绩)属性。Teacher与 Student之间有指导论文的联系,用Supervise表示,每位教师可指导多名研究生, 每名研究生有且只能有一位指导教师;Teacher与Course之间有讲授的联系,用 Teach表示,每位教师可以教授多门课程,每门 课程可同时由多位教师开设。试画

7、出E-R图。四、 12分题设与第三题相同,试根据你所画的E-R图,设计出关系数据库,并指出每个关系中 的主键和外键。五、8分题设与第三题相同,试用关系代数表达:1. 检索编号为t0的老师的姓名2. 检索班级号为b0或者年龄大于21岁所有学生的姓名六、12分题设与第三题相同。使用SQL表达:1 .建立表结构 Course(课程)、Teacher教师)、Student(研究生)(其中要求age大于零;定义必要的主键和外键)。2. 将学号为” a01姓名为” zhang年龄为” 22的学生信息加入到Student表中3. 检索专业为计算机的老师的姓名和编号,并按编号由大到小排列。4. 将学号以a0开

8、头的学生信息删除。5. 检索比b0班所有学生的总成绩都高的学生的姓名,去掉重复的姓名。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 A1、求X=BD关于F的闭包X+.2、求F的一个正则覆盖.3、求满足3NF分解的关系模

9、式九、12分设有如下调度S。T1T2T3read(B)write(B)read(B)read(A)write(B)write(A)read(B)write(B)read(A)write(A)read(A)write(A)1. 判别S是否为冲突可串行化调度?2. 如果是冲突可串行化调度,则给出与 S冲突等价的串行调度。习题答案八、12分用英文解释(每题3分)3、DBMS: A database man ageme nt system con sists of a collect ion of in terrelated data and a collectio n of programs to

10、access those data.4、Data dictionary: A data dictionary is a file that contains metadata, that is data about data.5、Tran sact ion: The tran sacti on is a unit of program executi on that accesses and possibly updates various data items.九、10分单项选择题(每题1分)1. 【B】2.【A】3.【C】4.【D】5.【D】6.【B】7.【A】8. 【C】9.【A】10.

11、【A】十、10分E-R 图:(1) 正确描述出Teacher Course Teach Supervise Student五个实体集及联系集及其相关属性 5分(2) 描述出Teacher和 Student之间为1对多关系-1分(3) 描述出Teacher和 Course之间为多对多关系-1分(4) 矩形、菱形等符号表示正确-3分十一、12分Course(cno, cname, mark)主键:eno 分Teacher (tno, tname, major)主键:tno 分Student (sno, sname, age, bno, tno,score主键:sno 夕卜键:tno-4分 其中主键

12、和外键各占1分Teach(tno, eno)主键:tno, eno夕卜键:tno 和 eno-4分 其中主键和外键各占1.5分十二、8分ntname( tno= to(Teacher) 分nsname( age21 or bno= b01(Student)-4 分十三、 12 分1create table Course ( cno char(4), cname char(10), mark integer, primary key (cno) -1 分 create table Teacher ( tno char(10), tname char(4), major char(8) prima

13、ry key (tno)-分 create table Student ( sno char(10), sname char(10), age integer, tno char(10), bno char(10), score integer, primary key (sno), foreign key(tno) references Teacher (tno), check (age0)-1 分create table Teach( tno char(10),eno char(4),primary key (tno,cno),foreign key (tno) referenees Te

14、acher (tno),foreign key (eno) references Course (eno) -分2. insert into Student(sno,sname,age) values (a01, zhang, 22)分3. Select tname, tnofrom Teacherwhere major=计算机order by tno desc -1.5 分 order by 语句正确占 0.5 分4. Delete from StudentWhere sno like a01%-1.5分like语句表达正确占0.5分5. select distinet snamefrom

15、Stude ntwhere score(select max(score)from stude ntwhere bno= b01 -)1.5 分6. Select avg(score)From stude ntwhere tno=(Select tnoFrom TeacherWhere tname=张山-1.5 分十四、12分-4分BC, AD, BE都是候选码,-4分1. 所有属性都是某个候选码的属性,显然是 3NF2. E C非平凡依赖,而E不是R的一个超码,R不属于BCNF -4分十五、 12 分 1. X+=ABDC-.5 分2. 正则覆盖: D A E C B CD-4.5 分 每个依赖 1.5分3. D,AE,CB,C,D B,E-6分 每个模式 1

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 活动策划

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号