2005-2006学年第二学期《数据库原理(双语)》 A卷(答案)
( 计算机科学与技术 专业 03 级)
授课班号 242601 学号 姓名 成绩
NOTE: The exam is clod book and clod notes, but you can bring a small electronic dictionary. You can answer in English or in Chine. But you are encouraged to answer in English.
Part I(15 points)Give a short description of following terms:
1.DDL and DML
DDL:Data Definition Language(数据定义语言):defines the tables ,views and indices.
DML:Data Manipulation Language(数据定义语言):retrieve data from databa and
update data.
2.The ACID properties of the transaction
A:means Atomicity(原子性);C:means Consistency(一致性);
I:means Isolation(隔离性);D:means Durability(持久性);
3.ODBC
ODBC: Open DataBa Connectivity(开放式数据库互联)。ODBC is a standard which defines a way for an application program to communicate with a databa rver.
4.Den index and spar index
Den index:An index record appears for every arch-key value in the file.
Spar: An index appears for only some of the arch-key values.
5.Physical Data Independence and Logical Data Independence.
Physical Data Independence(物理数据独立性):When physical schema changes, logical schema doesn’t change.
Logical Data Independence(逻辑数据独立性):When logical schema changes, the view level doesn’t change.
Part II(20 points)Answer the following questions by choosing A,B,C or D.:1负责物理结构和逻辑结构的定义和修改的人员是 B。
A.专业用户 B.DBA C.应用程序员 D.最终用户
2下述说法中没有体现数据库系统特点的是A。
A.数据面向应用程序
B.数据结构化
C.数据冗余小
D.数据共享性高
3__ A __是位于用户与操作系统之间的一层数据管理软件.
实践创新
A、数据库管理系统(DBMS)
B、数据库系统
C、数据库
D、数据库应用系统
4客户/服务器结构(C/S)与其它数据库体系结构的根本区别在于__D___。
A、数据共享
B、数据分布
C、网络开销小
D、DBMS和应用是分开的
5概念结构设计阶段得到的结果是___B _____。
A、数据字典描述的数据需求
B、E-R图表示的概念模型
C、某个DBMS所支持的数据模型
D、包括存储结构和存取方法的物理结构
6下面不属于实现安全性措施的是D。
A.授权规则
B.数据加密
C.视图机制
D.日志文件
7以下不属于完整性约束的是C。
A.主码约束
B.触发器
C.视图机制
D.CHECK约束
8在嵌入式SQL语言中使用游标的目的在于___ D_____。
A、区分SQL与宿主语言
B、与数据库通信
C、处理错误信息
D、处理多行记录
9一般地,一个数据库系统的外模式__ D______。
A.只能有一个
B.最多只能有一个
C.至少两个
D.可以有多个
10在视图上肯定不能完成的操作是C。
A.更新视图
B.查询
C.在视图上定义新的基本表
D.在视图上定义新视图
11下列聚合函数中不忽略空值 (null) 的是C。
A. SUM (列名)
B. MAX (列名)
C. COUNT ( * )
D. A VG (列名)
12数据库的并发操作可能带来的问题包括A。
A.丢失更新
B.数据独立性会提高
C.非法用户的使用
D.增加数据冗余度
13当关系R和S作自然连接时,能够将R和S中失配的元组放到结果关系中的操作是C。
A.左外连接
B. 右外连接
C.全外连接
D. 并
14将查询SC表的权限授予用户U1,并允许该用户将此权限授予其他用户。实现此功能的SQL语句是C。
A.GRANT SELECT TO SC ON U1 WITH PUBLIC
B.GRANT SELECT ON SC TO U1 WITH PUBLIC
C.GRANT SELECT ON SC TO U1 WITH GRANT OPTION
D.GRANT SELECT TO SC ON U1 WITH GRANT OPTION
15设有关系模式R(A,B,C,D),F是R上成立的FD集,F={B→C,C→D},则属性C的闭包C+为C。
A. BCD
B. BD
C. CD
D. BC
16有关系R和S,R∩S的运算等价于B。
A. S-(R-S)
关机快捷键是什么B. R-(R-S)
∪ D. R(R
电脑分辨率
∪-S)
C. (R-S)S
17如果事务T获得了数据项Q上的共享锁,则T对Q A。
A. 只能读不能写
B. 只能写不能读
C. 既可读又可写
D. 不能读不能写茶壶煮饺子
18数据库的封锁机制是B的主要方法。
A.完整性
B.并发控制
做梦梦到剪头发C.恢复
D.安全性
19设关系模式R (A,B,C),F是R上成立的FD集,F = {B→C},则分解ρ = {AB,BC}相对于F A。
A. 是无损联接,也是保持FD的分解
B. 是无损联接,但不保持FD的分解
C. 不是无损联接,但保持FD的分解
D. 既不是无损联接,也不保持FD 的分解
20在数据库系统中死锁属于B。
A.系统故障
B.程序故障
C.事务故障
D.介质故障
Part ⅣSimple questions (15 points)
1(5 points) List two main advantages of using views.
The main advantages of using views are as follows:
①Assure the curity of data becau views can hide some important data from urs.
②Realize the personalization of data becau views can only consist of the data which
urs need.
2(5 points)What is query processing? List the basic steps of query processing.
Query processing refers to the range of activities involved in extracting data from a databa.
The basic steps of query processing are :
①Parsing and translation;
②Optimization
③Evaluation
3 (5 points)What is the main goal to create an index? What is the difference between a
primary index and a condary index?
The main goal to create an index is to improve the efficiency of the arch.
The difference between a primary index and a condary index is as follows: The primary index is on the field which specifies the quential order of the file.
There can be only one primary index while there can be many condary indices.
Primary index can be spar index, while condary index must be den index.
Part ⅤAnswer the following questions(50 points)
1.(15 points) Construct the E-R diagram that best reprents the following statements; list the primary key of each entity. And then translate your E-R diagram into tables and specify the primary key and foreign key of the table
必须的意思Consider a library databa:
[1]. There are three entities as follows:
book(identified by book-id ) with attributes book-id, isbn, title (图书)
chief-author(identified by author-id) with attributes author-id, name, address(主编) publisher(identified by publisher-id ) with attributes publisher-id, name,city (出版社) reader(identified by reader-id) with attributes reader-id, name, phone(读者)
[2]. One reader can borrow one or many books, with additional attributes borrow-date,
return-date; one book can be borrowed by many readers at different time;
[3]. One publisher can publish many books and one book can only published by one
publisher;
[4]. One chief-author can write many books and one book has only one first-authors
E-R diagram is as follows:
变成回忆
Translate the E-R diagram into the following tables:
book(book--id ,title, isbn,author-id,publicsher-id) (Primary key: book-id)
(Foreign key:author-id, publisher-id) publisher(publisher-id,name,city) (Primary key: publisher-id)
reader(reader-id,name,phone) (Primary key: reader-id)
borrow(reader-id, book-id, borrow-date, return-date ) (Primary key: reader-id,book-id)
郭兰英南泥湾( foreign key read-id , book-id)
chief-author(author-id, name, adderss) (Primary key:author-id)
foreign key publisher-id , book-id
2.(10 points) Consider the following relational databa which specifies S, C, SC:
S(SNO, SNAME, AGE,SDEPT)
C(CNO,CNAME, TNAME)
SC(SNO,CNO,GRADE)
where: SNO-the No. of student; CNO-the No. of cour;
SNAME-the name of student; CNAME-the name of cour;
AGE-the age of student;TNAME -the name of cour’s teacher;
SDEPT-the name of student’s department;
GRADE – the score of the cour taken by student
For each of the following queries, give an expression in the relational algebra.
[1].Find the names and age of all students in the department ‘CS’;
[2].Find the names of the students who took the cour with the name ‘Programming’;
[3].Find the names of the students who didn’t take the cour with the number ‘C1’;
[4].Find the number of the students who took all the cours taught by teacher ‘Wang’