《《数据库原理(双语)》试卷.doc》由会员分享,可在线阅读,更多相关《《数据库原理(双语)》试卷.doc(10页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、姓名考试日期5807605040学号课程号教学班数据库原理(双语)2007年级课程名称专业密 封 线 西 南 石 油 大 学 试 卷 第 9 页 共 10 页数据库原理(双语)考试试卷(第一套)课程号5807605040考试时间100分钟适用专业年级(方向):计算机科学与技术2007级考试方式及要求:闭卷笔试题号一二三四五总分得分阅卷人一、单项选择题(每题2分,共40分,将答案填在下表内)题号12345678910答案题号11121314151617181920答案1. Physical data independence(物理数据独立性)( )AAllows us to access(访问)
2、 the physical data independently(独立地) from all applications(应用程序)BAllows us to rewrite(重写) the queries(查询) on the database without affecting(影响) the physical dataCAllows us to physically reorganize(重新组织) the data in the database without affecting the applications running on the databaseDAll of the a
3、bove2. Which of the following is NOT an advantage(优点) of database systems? ( )ARedundant data(冗余的数据) BProgram-data independence(应用程序与数据相互独立) CBetter data quality (更好的数据质量)DReduced program maintenance(减少应用程序维护)3. Which of the following is an example of a database integrity constraint(完整性约束条件)? ( )ATh
4、e grade assigned(分配) to a student for a course must be either an A, B, C, D or FBEvery course must have a unique(唯一的) value for its course number CThe name of any student must be less than 30 characters(字母) in lengthDAll of the above4. Customers(顾客), cars, and parts(零件) are examples of ( )Aentities(
5、实体) Battributes(属性) Crelations Drelationships(联系) 5. A(n) _ is the relationship between a weak entity type and its owner. ( ) Aweak relationship B identifying(识别) relationship Cnon-identifying(非识别) relationship Downer relationship6. The relational data model(关系数据模型) consists of(由组成) which components
6、(组件)? ( )AData structure(数据结构) BData manipulation(数据操作)CData integrity (完整性约束)DAll of the above 7. A primary key that consists of more than one attribute is called a( ) Aforeign key(外键)Bcomposite key(复合键)Cmultivalued key(多值键)Dcandidate key(候选键)8. A rule that states that each foreign key value must m
7、atch a primary key value in the other relation is called the( )Areferential integrity constraint(参照完整性约束)Bentity integrity constraint(实体完整性约束)Cdomain integrity constraint(域完整性约束)Dnull constraint(空值约束)9. Which of the following are anomalies(异常) that can be caused by redundancies(冗余) in tables? ( )Ain
8、sertion(插入) Bdeletion(删除) Cmodification(修改) Dall of the above 10. A candidate key(候选键) must satisfy(满足) all of the following conditions EXCEPT(除了)( )Athe key must uniquely(唯一地) identify(识别) the row Bthe key must indicate the rows position in the table(表明行在表中的位置)Cthe key must be nonredundant(非冗余的)Dea
9、ch nonprime attribute(非主属性) is functionally dependent upon(函数依赖于) it. 11. The intersection(交集) of two relations R(A,B,C) and S(A,B,C) can be computed by( )A RSBR(RS)C RSD all of the above12. This operation is commutative(可交换的) ( )A Union(并)B Intersection(交)C Cartesian product(笛卡尔积)D all of the above
10、13. What does the following SQL statement do? ( )Alter Table Customer_T Add (Type Varchar (2);AAlters the Customer_T table to accept Type 2 VarcharsBAlters the Customer_T table to be a Type 2 VarcharCAlters the Customer_T table, and adds a field called TypeDAlters the Customer_T table by adding a 2-
11、byte field called Varchar14. What does the following SQL statement do? ( )Update Product_T Set Unit_Price = 775 Where Product_ID = 7AChanges the price of a unit called Product_T to 7BChanges the unit price of Product 7 to 775CChanges the length of the Unit_Price field to 775DUpdates the Product_T ta
12、ble to have a unit price of 77515. Assume(假设) we have executed(执行) the following CREATE TABLE statement: CREATE TABLE Emp ( Ssn CHAR(9) Primary Key; SuperSsn CHAR(9) REFERENCES EMP(Ssn) ;Which of the following could be used to insert(插入) the first row into the Emp table? ( )AINSERT INTO Emp(Ssn) VAL
13、UES (123456789)BINSERT INTO Emp(Ssn, SuperSsn) VALUES (123456789, 987654321)CINSERT INTO Emp(SuperSsn) VALUES (987654321)Dall of the above 16. _ is a set of commands(命令) used to update and query a database. ( )ADML BDDL CDCL DDPL 17. In an SQL statement, which of the following finds all groups meeti
14、ng stated conditions(符合条件的组)? ( )ASelectBWhereCHaving DFind 18.To eliminate duplicate rows(消除重复行) in a query, the _ qualifier(限定符) is used in the SQL Select command. ( )AalterBdistinctCcheckDspecific 19. _ takes a value of true if a subquery(子查询) returns an intermediate results(中间结果) table which con
15、tains(包含) one or more rows. ( )AInBHavingCExistsDExtents20.A _is a temporary table(临时表) used in the FROM clause(子句) of an SQL query. ( )Acorrelated subquery(相关子查询)Bderived table(导出表)Cview table(视图表)DNone of the above二、判断题(每题1分,共10分,正确的填T,错误的填F,将答案填在下表内)题号12345678910答案1. We can define(定义) a relation
16、schema(关系模式) R(A1, A2, A3) where A1 is the primary key(主键) and A3 is a foreign key(外键) that refers to(参考) R.( )2. A constraint(约束) is a rule in a database system that can be violated(违反) by users. ( )3. The E-R model is used to construct(构建) a conceptual model(概念模型). ( )4. The entity integrity rule(
17、实体完整性规则)states that a primary key attribute can be null. ( )5. The attribute value in a tuple(元组) that makes up(组成) a foreign key(外键) can be null. ( )6. A composite key(复合键) consists of only one attribute. ( )7. One property(特征) of a relation is that each attribute within a relation has a unique(唯一的
18、) name. ( )8. The columns of a relation can be interchanged(交换) without changing the meaning or use of the relation. ( )9. The DELETE SQL command is used to remove(去掉) a table from the database. ( )10. Subqueries(子查询) can only be used in the WHERE clause. ( )三、操作题(每题3分,共15分)现有关系数据库模式如下:学生(学号,姓名,性别,专
19、业,年龄)课程(课程号,名称,学分)学习(学号,课程号,分数)用关系代数表达式实现12小题,用T-SQL语言实现35小题。1. 查询“学生”关系学生中都有哪些专业。2.检索“数据库原理”课程成绩高于90分的所有学生的学号、姓名、专业和分数。3. 检索没有选修课程号为“C135”课程的学生信息,包括学号,姓名和专业。4. 从“学生”关系中删除成绩出现过0分的所有学生信息。5. 定义“英语”专业学生所学课程的信息视图English_View,包括学号、姓名、课程号和分数。四、T-SQL编程题(10分)请用T-SQL编写程序计算1239899100的值。五、数据库设计题(第1题15分,第2题10分,
20、共25分)1. 某医院病房计算机管理系统中需要如下信息: 科室:科室名,科室地址,科室电话病房:病房号,床位数,所属科室名医生:姓名,职称,所属科室名,年龄,工作证号病人:病历号,姓名,性别,主管医生,病房号假设一个科室可有多个病房和多个医生,一个病房只能属于一个科室,一个医生只能属于一个科室,但可负责多个病人的诊治,一个病人的主管医生只有一个。一个病房可住多个病人。(1)设计满足上述业务需求的E-R图,并写出你在确定E-R模型约束条件时所做的其他假设(注意:实体、属性和联系名称均用中文表示)。 (2)将该E-R图转换为等价的符合第3范式(3NF)的关系模式,分别指出每个关系的主键和外键,并画出各关系间的主键、外键参照(注意:关系模式的表示规范请参照下图;关系和属性名称均用中文表示)。 2. 假设为自学考试成绩管理系统设计了一个关系R(S,SN,C,CN,G,U),其属性的含义依次为考生号、姓名、课程号、课程名、分数和主考学校名称。规定每个学生学习一门课程只有一个分数;一个主考学校主管多门课程的考试,且一门课程只能属于一个主考学校管理;每名考生有唯一的考生号,每门课程有唯一的课程号。(1)写出关系模式R基本的函数依赖集(即找出R中所有存在的函数依赖)。(2)写出关系模式R的候选键。(3)将R规范化为3NF。