四川大学数据库习题答案
- 格式:doc
- 大小:887.50 KB
- 文档页数:17
第一章数据库系统概述选择题1实体-联系模型中,属性是指(C)A.客观存在的事物B.事物的具体描述C.事物的某一特征D.某一具体事件2对于现实世界中事物的特征,在E-R模型中使用(A)A属性描述B关键字描述C二维表格描述D实体描述3假设一个书店用这样一组属性描述图书(书号,书名,作者,出版社,出版日期),可以作为“键”的属性是(A)A书号B书名C作者D出版社4一名作家与他所出版过的书籍之间的联系类型是(B)A一对一B一对多C多对多D都不是5若无法确定哪个属性为某实体的键,则(A)A该实体没有键B必须增加一个属性作为该实体的键C取一个外关键字作为实体的键D该实体的所有属性构成键填空题1对于现实世界中事物的特征在E-R模型中使用属性进行描述2确定属性的两条基本原则是不可分和无关联3在描述实体集的所有属性中,可以唯一的标识每个实体的属性称为键4实体集之间联系的三种类型分别是1:1 、1:n 、和m:n5数据的完整性是指数据的正确性、有效性、相容性、和一致性简答题一、简述数据库的设计步骤答:1需求分析:对需要使用数据库系统来进行管理的现实世界中对象的业务流程、业务规则和所涉及的数据进行调查、分析和研究,充分理解现实世界中的实际问题和需求。
分析的策略:自下而上——静态需求、自上而下——动态需求2数据库概念设计:数据库概念设计是在需求分析的基础上,建立概念数据模型,用概念模型描述实际问题所涉及的数据及数据之间的联系。
3数据库逻辑设计:数据库逻辑设计是根据概念数据模型建立逻辑数据模型,逻辑数据模型是一种面向数据库系统的数据模型。
4数据库实现:依据关系模型,在数据库管理系统环境中建立数据库。
二、数据库的功能答:1提供数据定义语言,允许使用者建立新的数据库并建立数据的逻辑结构2提供数据查询语言3提供数据操纵语言4支持大量数据存储5控制并发访问三、数据库的特点答:1数据结构化。
2数据高度共享、低冗余度、易扩充3数据独立4数据由数据库管理系统统一管理和控制:(1)数据安全性(2)数据完整性(3)并发控制(4)数据库恢复第二章关系模型和关系数据库选择题1把E-R模型转换为关系模型时,A实体(“一”方)和B实体(“多”方)之间一对多联系在关系模型中是通过(A)来实现的A将A关系的关键字放入B关系中B建立新的关键字C建立新的联系D建立新的实体2关系S和关系R集合运算的结果中既包含S中元组也包含R中元组,但不包含重复元组,这种集合运算称为(A)A并运算B交运算C差运算D积运算3设有关系R1和R2,经过关系运算得到结果S,则S是一个(D)A字段B记录C数据库D关系4关系数据操作的基础是关系代数。
四川⼤学数据库技术复习题⼀选择题数据库技术试题⼀、选择题1. 单个⽤户使⽤的数据视图的描述称为A. 外模式B. 概念模式C. 内模式D. 存储模式2. ⼦模式DDL⽤来描述A. 数据库的总体逻辑结构B. 数据库的局部逻辑结构C. 数据库的物理存储结构D. 数据库的概念结构3. 在DBS中,DBMS和OS之间的关系是A. 相互调⽤B. DBMS调⽤OSC. OS调⽤DBMSD. 并发运⾏4. 当关系R和S⾃然联接时,能够把R和S原该舍弃的元组放到结果关系中的操作是A. 左外联接B. 右外联接C. 外部并D. 外联接5. 下列聚合函数中不忽略空值 (null) 的是A. SUM(列名)B. MAX(列名)C. COUNT( * )D. AVG(列名)6. 设关系模式R (A,B,C),F是R上成⽴的FD集,F = {B→C},则分解ρ = {AB,BC}相对于FA. 是⽆损联接,也是保持FD的分解B. 是⽆损联接,但不保持FD的分解C. 不是⽆损联接,但保持FD的分解D. 既不是⽆损联接,也不保持FD 的分解B. 逻辑设计阶段C. 概念设计阶段D. 物理设计阶段8. SQL中,下列涉及空值的操作,不正确的是A. AGE IS NULLB. AGE IS NOT NULLC. AGE = NULLD. NOT (AGE IS NULL)9. ⼀个关系中的候选关键字。
A .⾄多⼀个B .可多个C .必须多个D .⾄少 3 个10. DBMS中实现事务持久性的⼦系统是A. 安全性管理⼦系统B. 完整性管理⼦系统C. 并发控制⼦系统D. 恢复管理⼦系统11. SQL的全局约束是指基于元组的检查⼦句和A. ⾮空值约束B. 域约束⼦句C. 断⾔D. 外键⼦句12. 分布式数据库系统中分⽚模式和分配模式均是A. 全局的B. 局部的C. 分布的D. 集中的13. 属性类型允许是基本数据类型、结构类型和集合类型的模型是A. 平⾯关系模型B. 嵌套关系模型C. 复合对象模型D. 分布式关系模型14. ⽤树型结构表⽰实体之间联系的数据模型称为D.层次模型15. 数据库系统的核⼼是A.数据库B.数据库管理系统C.数据模型D.软件⼯具16. 在SQL语⾔中,与X BETWEEN 10 AND 20等价的表达式是A.X>10 AND X<20B.X>=10 AND X<20C.X>10 AND X<=20D.X>=10 AND X<=2017. 某个E-R图中有5个实体型,2个1∶n联系和2个m∶n联系,则该E-R图转换的关系模式个数⾄少是A.5个B.7个C.8个D.9个18. 若关系模式R(V,F)中的每⼀个决定属性集都包含候选码,则R属于A.2NFB.3NFC.BCNFD.4NF19. 若事务T对数据R已加X锁,则其他事务对数据RA.可以加S锁不能加X锁B.不能加S锁可以加X锁C.可以加S锁也可以加X锁D.不能加任何锁20.在⽬前的并⾏数据库体系结构中,可扩充性最⾼的是A.SMB.SDC.SND.SK21.数据的正确性和相容性是指数据库的A.完整性22.下列不属于事务的特性的是A.隔离性B.⼀致性C.完整性D.原⼦性23.系统在运⾏过程中,由于某种硬件故障,使存储在外存上的数据部分损失或全部损失,这种情况属于A.事务故障B.系统故障C.介质故障D.运⾏故障24.E-R图是数据库设计的常⽤⼯具之⼀,它适⽤于建⽴数据库的A.概念模型B.逻辑模型C.结构模型D.物理模型25.数据库逻辑结构设计的主要任务是A.建⽴E-R图B.把数据送⼊数据库C.建⽴数据流图和需求说明书D.将E-R图转换为某个DBMS所⽀持的数据模型26.下⾯不是SQL语⾔优点的是。
【最新大学期末考试题库答案】四川大学数据库系统_双语期末考题311038040数据库系统(双语)(A闭)2012-2013-11.Multiple Choices (20 marks, 2 marks for each)1) In a database system, whose responsibility is it to providedata consistencyA. the database administrator'sB. the DBMS'sC. the user'sD. the application programmer'srefers to the ability to change2) The term logical data independenceA. the conceptual schema without changing the external schemas, or the application programsB. the physical schema of the data without changing the external schemas, the conceptual schemas, orthe application programsC. the application programs without changing the conceptual schemaD. the data without physically relocating the tables3) A database is needed for which of the followingapplication scenariosI. A video store that needs to keep track of data about members, about videos carried by the store,about videos rented by members, as well as data concerning borrow-date, return-date, and payment information.II. In the human resources department of a company,information about employees, their titles, their salaries and sick days, and about vacation days taken by each employee.III. A computer-simulated video game which needs to calculate and display, the physical (x, y) location of each actor in the game, the speed with which they are moving at the current instant, the direction in which they are moving, the action they are performing, the angle at which the game-player is viewing the scene.A. I and II onlyB. I onlyC. I and III onlyD. I, II, and IIIENTITY TYPE in ER modeling.4) Which of the following are usually used to representsA. verbB. nounC. proposition.D. adjective5) What information is necessary when specifying the structure of a table in a relational schema?A. the name of the table, the names of the table's attributes, the data types of attributes, and the formatsof attributesB. the name of the table and the names of the table's attributesC. the name of the table, the names of the table's attributes, the data types of the table's attributes, theformats of the table's attributes, and the maximum number of rows that the table can haveD. the name of the table and the amount of storage space tobe allocated to the table6) Which of the following problems can be caused by data redundancy in a relational schema?I. Inefficient use of spaceII. Update anomalies and possible loss of dataIII. Inefficient use of processing timeA. I and II onlyB. II onlyC. I and III onlyD. I, II, and III7) Which of the following are properties of transactions in database systems?I. Atomicity and DurabilityII. Consistency and IsolationIII. Unique and Independent1 / 3。
一.单选题(共44题,52.8分)1采用开放定址法处理散列表的冲突时,其平均查找长度( )。
•A、低于链接法处理冲突•B、高于链接法处理冲突•C、与链接法处理冲突相同•D、高于二分查找正确答案:B 我的答案:B得分:1.2分答案解析:2在二叉树结点的先序序列、中序序列和后序序列中,所有叶子结点的先后顺序( )。
•A、都不相同•B、完全相同•C、先序和中序相同,而与后序不同•D、中序和后序相同,而与先序不同正确答案:B 我的答案:B得分:1.2分答案解析:3对一个算法的评价,不包括如下( )方面的内容。
•A、健壮性和可读性•B、并行性•C、正确性•D、时空复杂度正确答案:B 我的答案:B得分:1.2分答案解析:4对于关键字序列(7,34,77,25,64,49,20,14)进行散列存储时,若选用H(K)=K%7作为散列函数,则散列地址为0的元素有( )个。
•A、1•B、2•C、3•D、4正确答案:D 我的答案:得分:0.0分答案解析:5该二叉树有( )个叶子。
•A、3•B、2•C、5•D、4正确答案:A 我的答案:A得分:1.2分答案解析:6从二叉搜索树中查找一个元素时,其时间复杂度大致为( )。
•A、O(n)•B、O(1)•C、O(log2n)•D、O(n2)正确答案:C 我的答案:C得分:1.2分答案解析:7数据的基本单位是( )。
•A、数据项•B、数据类型•C、数据元素•D、数据变量正确答案:A 我的答案:A得分:1.2分答案解析:8设有6个结点的无向图,该图至少应有( )条边才能确保是一个连通图。
•A、5•B、6•C、7•D、8正确答案:A 我的答案:A得分:1.2分答案解析:9对n个记录进行堆排序,所需要的辅助存储空间为( )。
•A、O(1og2n)•B、O(n)•C、O(1)•D、O(n2)正确答案:C 我的答案:C得分:1.2分答案解析:10设有一个二维数组A[m][n],假设A[0][0]存放位置在644,A[2][2]存放位置在676,每个元素占一个空间,则A[3][3]存放位置在( )。
(b)等值连接不把重复属性去掉,而自然连接要把重复属性去掉。
3、为什么将SQL 中的视图称为“虚表”?答:在SQL中创建一个视图时,系统只是将视图的定义存放在数据字典中,并不存储视图对应的数据,在用户使用视图时才去求对应的数据,因此,我们将视图称为“虚表”。
这样处理的目的是为了节约存储空间,因为视图对应的数据都可从相应的基本表中获得。
4、列出3条查询优化的启发式规则。
答:3 条启发式优化规则是:尽可能早地执行选择运算,尽可能早地执行投影运算,把笛卡尔积与附近的一连串选择和投影合并起来做。
5、试叙述“串行调度”与“可串行化调度”的区别。
答:事务的执行次序称为调度。
如果多个事务依次执行,则称为事务的串行调度。
如果利用分时的方法,同时处理多个事务,则称为事务的并发调度。
如果一个并发调度的结果与某一串行调度的执行结果等价,那么这个并发调度称为是可串行化的调度。
三、设计题(共8分)在学术论文完成过程中,一位学者可以撰写多篇论文,一篇论文也可由多位学者合著,每篇论文的作者都有一个排序。
一篇论文只能发表一次,学术刊物的某一辑(卷号、期号)发表多篇论文在。
设学者的属性有:身份证号、姓名、单位、通讯地址;论文的属性有:论文题目、主题、术语;学术刊物的属性有:ISBN号、名称、影响因子。
试完成以下两题:(1)根据这段话的意思,画出其E-R 图。
(4分)(2)将这个E-R 图转换为满足3NF的关系模式,并给出各关系模式中的主码。
(4分)(3)SELECT DISTINCT X.SnoFROM SC X, SC YWHERE X.Sno=Y.Sno AND o!=o;(4)SELECT DISTINCT SnoFROM SC XWHERE NOT EXISTS(SELECT *FROM CWHERE Teacher='张' AND NOT EXISTS(SELECT *FROM SC YWHERE Y.Sno=X.Sno AND o=o));五、查询优化(共10分)给定“学生-课程”数据库的关系模式如三大题4小题:S(Sno,Sname,Sgender,Sage)SC(Sno,Cno,Grade)C(Cno,Cname,Teacher)对查询“检索选修“信息系统”课程的学生姓名与年龄。
四川⼤学数据库技术复习题三操作题数据库技术试题三、操作题1. 设有关系数据库:职⼯关系EMPLOYEE (职⼯号,职⼯名,街道,城市)⼯作关系WORKS (职⼯号,公司号,⼯资)公司关系COMPANY (公司号,公司名,城市)假设职⼯可在多个公司兼职,请⽤关系代数表达式写出⾄少在公司号为‘C2’和‘C5’公司兼职的职⼯的职⼯号。
2. 设有关系数据库:职⼯关系EMPLOYEE (职⼯号,职⼯名,街道,城市)⼯作关系WORKS (职⼯号,公司号,⼯资)公司关系COMPANY (公司号,公司名,城市)试⽤SQL语句写出下列操作:将所有在“联华公司”⼯作的职⼯加薪5﹪。
3. 图书出版管理数据库中有两个基本表:图书 (书号,书名,作者编号,出版社,出版⽇期)作者 (作者编号,作者名,年龄,地址)试⽤SQL语句写出下列查询:检索年龄低于作者平均年龄的所有作者的作者名、书名和出版社。
4. 设有商店和顾客两个实体,“商店”有属性商店编号、商店名、地址、电话,“顾客”有属性顾客编号、姓名、地址、年龄、性别。
假设⼀个商店有多个顾客购物,⼀个顾客可以到多个商店购物,顾客每次去商店购物有⼀个消费⾦额和⽇期,⽽且规定每个顾客在每个商店⾥每天最多消费⼀次。
试画出ER图,并注明属性和联系类型。
5. 学校有多名学⽣,财务处每年要收⼀次学费。
为财务处收学费⼯作设计⼀个数据库,包括两个关系:学⽣ (学号,姓名,专业,⼊学⽇期)收费 (学年,学号,学费,书费,总⾦额)假设规定属性的类型:学费、书费、总⾦额为数值型数据;学号、姓名、学年、专业为字符型数据;⼊学⽇期为⽇期型数据。
列的宽度⾃定义。
试⽤SQL语句定义上述表的结构。
(定义中应包括主键⼦句和外键⼦句)6. ⽤SQL语⾔定义(1) 学⽣关系S,包括学号SNo、姓名SN、年龄SA、系别SD;(2) 课程关系C,包括课程号CNo、课程名CN、学分CC;(3) 学⽣选课关系SC,包括SNo、CNo和成绩G。
第1章数据概述一.选择题1.下列关于数据库管理系统的说法,错误的是CA.数据库管理系统与操作系统有关,操作系统的类型决定了能够运行的数据库管理系统的类型B.数据库管理系统对数据库文件的访问必须经过操作系统实现才能实现C.数据库应用程序可以不经过数据库管理系统而直接读取数据库文件D.数据库管理系统对用户隐藏了数据库文件的存放位置和文件名2.下列关于用文件管理数据的说法,错误的是DA.用文件管理数据,难以提供应用程序对数据的独立性B.当存储数据的文件名发生变化时,必须修改访问数据文件的应用程序C.用文件存储数据的方式难以实现数据访问的安全控制D.将相关的数据存储在一个文件中,有利于用户对数据进行分类,因此也可以加快用户操作数据的效率3.下列说法中,不属于数据库管理系统特征的是CA.提供了应用程序和数据的独立性B.所有的数据作为一个整体考虑,因此是相互关联的数据的集合C.用户访问数据时,需要知道存储数据的文件的物理信息D.能够保证数据库数据的可靠性,即使在存储数据的硬盘出现故障时,也能防止数据丢失5.在数据库系统中,数据库管理系统和操作系统之间的关系是DA.相互调用B.数据库管理系统调用操作系统C.操作系统调用数据库管理系统D.并发运行6.数据库系统的物理独立性是指DA.不会因为数据的变化而影响应用程序B.不会因为数据存储结构的变化而影响应用程序C.不会因为数据存储策略的变化而影响数据的存储结构D.不会因为数据逻辑结构的变化而影响应用程序7.数据库管理系统是数据库系统的核心,它负责有效地组织、存储和管理数据,它位于用户和操作系统之间,属于AA.系统软件B.工具软件C.应用软件D.数据软件8.数据库系统是由若干部分组成的。
下列不属于数据库系统组成部分的是B A.数据库B.操作系统C.应用程序D.数据库管理系统9.下列关于客户/服务器结构和文件服务器结构的描述,错误的是DA.客户/服务器结构将数据库存储在服务器端,文件服务器结构将数据存储在客户端B.客户/服务器结构返回给客户端的是处理后的结果数据,文件服务器结构返回给客户端的是包含客户所需数据的文件C.客户/服务器结构比文件服务器结构的网络开销小D.客户/服务器结构可以提供数据共享功能,而用文件服务器结构存储的数据不能共享数据库是相互关联的数据的集合,它用综合的方法组织数据,具有较小的数据冗余,可供多个用户共享,具有较高的数据独立性,具有安全控制机制,能够保证数据的安全、可靠,允许并发地使用数据库,能有效、及时地处理数据,并能保证数据的一致性和完整性。
_______________________________ 少年易学老难成,一寸光阴不可轻-百度文库一Chapter 1 Data Structures and Algorithms: Instructor's CD questions1.The primary purpose of most computer programs isa)to perform a mathematical calculation.*b) to store and retrieve information.c)to sort a collection of records.d)all of the above.e)none of the above.2.An integer is aa)) simple typeb)aggregate typec)composite typed)a and be)none of the above3.A payroll records is aa)simple typeb)aggregate typec)composite type*d) a and b e) none of the above4.Which of the following should NOT be viewed as an ADT?a)listb)integerc)array*d) none of the above5.A mathematical function is most like a*a) Problemb)Algorithmc)Program6.An algorithm must be or do all of the following EXCEPT:a)correctb)composed of concrete steps*c) ambiguousd)composed of a finite number of stepse)terminate7.A solution is efficient ifa.it solves a problem within the require resource constraints.b.it solves a problem within human reaction time.1_______________________________ 少年易学老难成,一寸光阴不可轻-百度文库_______ c.it solves a problem faster than other known solutions.d.a and b.*e. a and c.f. b and c.8.An array isa)A contiguous block of memory locations where each memory location storesa fixed-length data item.b)An ADT composed of a homogeneous collection of data items, each data item identified by a particular number.c)a set of integer values.*d) a and b.e)a and c.f)b and c.9.Order the following steps to selecting a data structure to solve a problem.(1)Determine the basic operations to be supported.(2)Quantify the resource constraints for each operation.(3)Select the data structure that best meets these requirements.(4)Analyze the problem to determine the resource constraints that anysolution must meet.a)(1, 2, 3, 4)b)(2, 3, 1, 4)c)(2, 1, 3, 4)*d) (1, 2, 4, 3)e) (1, 4, 3, 2)10.Searching for all those records in a database with key value between 10 and 100 is known as:a) An exact match query.*b) A range query.c)A sequential search.d)A binary search.Chapter 2 Mathematical Preliminaries: Instructor's CD questions1.A set has the following properties:a)May have duplicates, element have a position.b)May have duplicates, elements do not have a position.c)May not have duplicates, elements have a position.*d) May not have duplicates, elements do not have a position._______________________________ 少年易学老难成,一寸光阴不可轻-百度文库2.A sequence has the following properties:a)) May have duplicates, element have a position.b)May have duplicates, elements do not have a position.c)May not have duplicates, elements have a position.d)May not have duplicates, elements do not have a position.3.For set F, the notation |P| indicatesa)) The number of elements in Pb)The inverse of Pc)The powerset of F.d)None of the above.4.Assume that P contains n elements. The number of sets in the powerset of P isa)nb)n A2*c) 2A nd)2A n - 1e) 2A n + 15.If a sequence has n values, then the number of permutations for that sequence will bea)nb)n A2c)n A2 - 1d)2A n*e) n!6.If R is a binary relation over set S, then R is reflexive if*a) aRa for all a in S.b)whenever aRb, then bRa, for all a, b in S.c)whenever aRb and bRa, then a = b, for all a, b in S.d)whenever aRb and aRc, then aRc, for all a, b, c in S.7.If R is a binary relation over set S, then R is transitive ifa)aRa for all a in S.b)whenever aRb, then bRa, for all a, b in S.c)whenever aRb and bRa, then a = b, for all a, b in S.*d) whenever aRb and aRc, then aRc, for all a, b, c in S.8.R is an equivalence relation on set S if it isa)) reflexive, symmetric, transitive.b)reflexive, antisymmetric, transitive.c)symmetric, transitive.少年易学老难成,一寸光阴不可轻-百度文库d)antisymmetric, transitive.e)irreflexive, symmetric, transitive.f)irreflexive, antisymmetric, transitive.9.For the powerset of integers, the subset operation defines *a) a partial order.b)a total order.c)a transitive order.d)none of the above.10.log nm is equal toa) n + m*b) log n + log mc)m log nd)log n - log m11.A close-form solution isa) an analysis for a program.*b) an equation that directly computes the value of a summation.c) a complete solution for a problem.12.Mathematical induction is most likea) iteration.*b) recursion.c)branching.d)divide and conquer.13.A recurrence relation is often used to model programs witha)for loops.b)branch control like "if" statements.*c) recursive calls.d) function calls.14.Which of the following is not a good proof technique.a) proof by contradiction.*b) proof by example.c) proof by mathematical induction.15.We can use mathematical induction to:a) Find a closed-form solution for a summation.*b) Verify a proposed closed-form solution for a summation.c) Both find and verify a closed-form solution for a summation._______________________________ 少年易学老难成,一寸光阴不可轻-百度文库一Chapter 3 Algorithm Analysis: Instructor's CD questions1.A growth rate applies to:a)the time taken by an algorithm in the average case.b)the time taken by an algorithm as the input size grows.c)the space taken by an algorithm in the average case.d)the space taken by an algorithm as the input size grows.e)any resource you wish to measure for an algorithm in the average case.*f) any resource you wish to measure for an algorithm as the input size grows.2.Pick the growth rate that corresponds to the most efficient algorithm as n gets large:a) 5n*b) 20 log nc)2nA2d)2A n3.Pick the growth rate that corresponds to the most efficient algorithm when n =4.a)5nb)20 log nc)2nA2*d)2A n4.Pick the quadratic growth rate.a)5nb)20 log n*c) 2nA2d) 2An5.Asymptotic analysis refers to:a) The cost of an algorithm in its best, worst, or average case.*b) The growth in cost of an algorithm as the input size grows towards infinity.c)The size of a data structure.d)The cost of an algorithm for small input sizes6.For an air traffic control system, the most important metric is:a)The best-case upper bound.b)The average-case upper bound.c)) The worst-case upper bound.d)The best-case lower bound._______________________________ 少年易学老难成,一寸光阴不可轻-百度文库__________e)The average-case lower bound.f)The worst-case lower bound.7.When we wish to describe the upper bound for a problem we use:a)) The upper bound of the best algorithm we know.b)The lower bound of the best algorithm we know.c)We can't talk about the upper bound of a problem because there can alwaysbe an arbitrarily slow algorithm.8.When we describe the lower bound for a problem we use:a)The upper bound for the best algorithm we know.b)the lower bound for the best algorithm we know.c)The smallest upper bound that we can prove for the best algorithm that could possibly exist.*d) The greatest lower bound that we can prove for the best algorithm that could possibly exist.9.When the upper and lower bounds for an algorithm are the same, we use:a)big-Oh notation.b)big-Omega notation.*c) Theta notation.d)asymptotic analysis.e)Average case analysis.f)Worst case analysis.10. When performing asymptotic analysis, we can ignore constants and low order terms because:*a) We are measuring the growth rate as the input size gets large.b)We are only interested in small input sizes.c)We are studying the worst case behavior.d)We only need an approximation.11.The best case for an algorithm refers to:a) The smallest possible input size.*b) The specific input instance of a given size that gives the lowest cost.c)The largest possible input size that meets the required growth rate.d)The specific input instance of a given size that gives the greatest cost.12.For any algorithm:a)) The upper and lower bounds always meet, but we might not know what they are.少年易学老难成,一寸光阴不可轻-百度文库b)The upper and lower bounds might or might not meet.c)We can always determine the upper bound, but might not be able to determine the lower bound.d)We can always determine the lower bound, but might not be able to determine the upper bound.13.If an algorithm is Theta(f(n)) in the average case, then it is: a) Omega(f(n)) in the best case.*b) Omega(f(n)) in the worst case.c) O(f(n)) in the worst case.14.For the purpose of performing algorithm analysis, an important property ofa basic operation is that:a)It be fast.b)It be slow enough to measure.c)Its cost does depend on the value of its operands.*d) Its cost does not depend on the value of its operands.15.For sequential search,a) The best, average, and worst cases are asymptotically the same.*b) The best case is asymptotically better than the average and worst cases.c)The best and average cases are asymptotically better than the worst case.d)The best case is asymptotically better than the average case, and the average case is asymptotically better than the worst case.Chapter 4 Lists, Stacks and Queues: Instructor's CD questions1.An ordered list is one in which:a) The element values are in sorted order.*b) Each element a position within the list.2.An ordered list is most like a:a)set.b)bag.c)) sequence.3.As compared to the linked list implementation for lists, the array-based listimplementation requires:a)More spaceb)Less space*c) More or less space depending on how many elements are in the list._______________________________ 少年易学老难成,一寸光阴不可轻-百度文库4.Here is a series of C++ statements using the list ADT in the book.L1.append(10);L1.append(20);L1.append(15);If these statements are applied to an empty list, the result will look like:a)< 10 20 15 >*b) < | 10 20 15 >c)< 10 20 15 | >d)< 15 20 10 >e)< | 15 20 10 >f)< 15 20 10 | >5.When comparing the array-based and linked implementations, the array-based implementation has:a)) faster direct access to elements by position, but slower insert/delete from the current position.b)slower direct access to elements by position, but faster insert/delete from the current position.c)both faster direct access to elements by position, and faster insert/delete from the current position.d)both slower direct access to elements by position, and slower insert/delete from the current position.6.For a list of length n, the linked-list implementation's prev function requiresworst-case time:a)O(1).b)O(log n).*c) O(n).d) O(n A2).7.Finding the element in an array-based list with a given key value requiresworst case time:a)O(1).b)O(log n).*c) O(n).d) O(n A2).8.In the linked-list implementation presented in the book, a header node isused:*a) To simplify special cases._______________________________ 少年易学老难成,一寸光阴不可轻-百度文库一b)Because the insert and delete routines won't work correctly without it.c)Because there would be no other way to make the current pointer indicatethe first element on the list.9.When a pointer requires 4 bytes and a data element requires 4 bytes, thelinked list implementation requires less space than the array-based list implementation when the array would be:a)less than 1/4 full.b)less than 1/3 full.*c) less than half full.d)less than 第full.e)less than 34 fullf)never.10.When a pointer requires 4 bytes and a data element requires 12 bytes, thelinked list implementation requires less space than the array-based list implementation when the array would be:a)) less than 1/4 full.b)less than 1/3 full.c)less than half full.d)less than 2/3 full.e)less than 34 fullf)never.11.When we say that a list implementation enforces homogeneity, we meanthat:a) All list elements have the same size.*b) All list elements have the same type.c) All list elements appear in sort order.12.When comparing the doubly and singly linked list implementations, we findthat the doubly linked list implementation*a) Saves time on some operations at the expense of additional space.b)Saves neither time nor space, but is easier to implement.c)Saves neither time nor space, and is also harder to implement.13. We use a comparator function in the Dictionary class ADT:a)to simplify implementation.*b) to increase the opportunity for code reuse.c) to improve asymptotic efficiency of some functions.14.All operations on a stack can be implemented in constant time except:少年易学老难成,一寸光阴不可轻-百度文库a) Pushb)Popc)The implementor's choice of push or pop (they cannot both be implementedin constant time).*d) None of the above.15.Recursion is generally implemented usinga) A sorted list.*b) A stack.c) A queue.Chapter 5 Binary Trees: Instructor's CD questions1.The height of a binary tree is:a)The height of the deepest node.b)The depth of the deepest node.*c) One more than the depth of the deepest node.2.A full binary tree is one in which:*a) Every internal node has two non-empty children.b) all of the levels, except possibly the bottom level, are filled.3.The relationship between a full and a complete binary tree is:a)Every complete binary tree is full.b)Every full binary tree is complete.*c) None of the above.4.The Full Binary Tree Theorem states that:a)) The number of leaves in a non-empty full binary tree is one more than the number of internal nodes.b)The number of leaves in a non-empty full binary tree is one less than the number of internal nodes.c)The number of leaves in a non-empty full binary tree is one half of the number of internal nodes.d)The number of internal nodes in a non-empty full binary tree is one half of the number of leaves.5.The correct traversal to use on a BST to visit the nodes in sorted order is:a) Preorder traversal.*b) Inorder traversal.c) Postorder traversal.6. When every node of a full binary tree stores a 4-byte data field,10少年易学老难成,一寸光阴不可轻-百度文库two 4-byte child pointers, and a 4-byte parent pointer, theoverhead fraction is approximately:a)one quarter.b)one third.c)one half.d)two thirds.*e) three quarters.f) none of the above.7.When every node of a full binary tree stores an 8-byte data field and two 4-byte child pointers, the overhead fraction is approximately:a)one quarter.b)one third.*c) one half.d)two thirds.e)three quarters.f)none of the above.8.When every node of a full binary tree stores a 4-byte data field and theinternal nodes store two 4-byte child pointers, the overhead fraction is approximately:a)one quarter.b)one third.*c) one half.d)two thirds.e)three quarters.f)none of the above.9.If a node is at position r in the array implementation for a complete binarytree, then its parent is at:a)) (r - 1)/2 if r > 0b)2r + 1 if (2r + 1) < nc)2r + 2 if (2r + 2) < nd)r - 1 if r is evene)r + 1 if r is odd.10.If a node is at position r in the array implementation for a complete binarytree, then its right child is at:a)(r - 1)/2 if r > 0b)2r + 1 if (2r + 1) < n*c) 2r + 2 if (2r + 2) < nd)r - 1 if r is evene)r + 1 if r is odd.11_______________________________ 少年易学老难成,一寸光阴不可轻-百度文库—11.Assume a BST is implemented so that all nodes in the left subtree of agiven node have values less than that node, and all nodes in the rightsubtree have values greater than or equal to that node. Whenimplementing the delete routine, we must select as its replacement:a) The greatest value from the left subtree.*b) The least value from the right subtree.c) Either of the above.12.Which of the following is a true statement:a)In a BST, the left child of any node is less than the right child, and in a heap, the left child of any node is less than the right child.*b) In a BST, the left child of any node is less than the right child, but in a heap, the left child of any node could be less than or greater than the right child.c)In a BST, the left child of any node could be less or greater than the right child, but in a heap, the left child of any node must be less than the right child.d)In both a BST and a heap, the left child of any node could be either less than or greater than the right child.13.When implementing heaps and BSTs, which is the best answer?a)The time to build a BST of n nodes is O(n log n), and the time to build a heap of n nodes is O(n log n).b)The time to build a BST of n nodes is O(n), and the time to build a heap of n nodes is O(n log n).*c) The time to build a BST of n nodes is O(n log n), and the time to build a heap of n nodes is O(n).d) The time to build a BST of n nodes is O(n), and the time to build a heap of n nodes is O(n).14.The Huffman coding tree works best when the frequencies for letters area) Roughly the same for all letters.*b) Skewed so that there is a great difference in relative frequencies for various letters.15.Huffman coding provides the optimal coding when:a)The messages are in English.b)The messages are binary numbers.*c) The frequency of occurrence for a letter is independent of its context within the message.d) Never.12_______________________________ 少年易学老难成,一寸光阴不可轻-百度文库一Chapter 6 Binary Trees: Instructor's CD questions1.The primary ADT access functions used to traverse a general tree are: a) left child and right siblingb) left child and right child*c) leftmost child and right siblingd) leftmost child and next child2.The tree traversal that makes the least sense for a general treeis:a) preorder traversal*b) inorder traversalc) postorder traversal3.The primary access function used to navigate the general tree when performing UNION/FIND is:a)left childb)leftmost childc)right childd)right sibling*e) parent4.When using the weighted union rule for merging disjoint sets, the maximum depth for any node in a tree of size n will be:a) nearly constant*b) log nc)nd)n log ne)n A25.We use the parent pointer representation for general trees to solve which problem?a)Shortest pathsb)General tree traversal*c) Equivalence classesd) Exact-match query6. When using path compression along with the weighted union rule for merging disjoint sets, the average cost for any UNION or FIND operation in a tree of size n will be:*a) nearly constantb)log nc)nd)n log n13_______________________________ 少年易学老难成,一寸光阴不可轻-百度文库一7.The most space efficient representation for general trees will typically be:a) List of children*b) Left-child/right siblingc) A K-ary tree.8.The easiest way to represent a general tree is to:a) convert to a list.*b) convert to a binary tree.c) convert to a graph.9.As K gets bigger, the ratio of internal nodes to leaf nodes:a)) Gets smaller.b)Stays the same.c)Gets bigger.d)Cannot be determined, since it depends on the particular configuration of the tree.10.A sequential tree representation is best used for:*a) Archiving the tree to disk.b)Use in dynamic in-memory applications.c)Encryption algorithms.d)It is never better than a dynamic representation.Chapter 7 Internal Sorting: Instructor's CD questions1.A sorting algorithm is stable if it:a) Works for all inputs.*b) Does not change the relative ordering of records with identical key values.c) Always sorts in the same amount of time (within a constant factor) for a given input size.2.Which sorting algorithm does not have any practical use?a) Insertion sort.*b) Bubble sort.c)Quicksort.d)Radix Sort.e)a and b.3.When sorting n records, Insertion sort has best-case cost:a)O(log n).14_______________________________ 少年易学老难成,一寸光阴不可轻-百度文库*b) O(n).c)O(n log n).e)O(n!)f)None of the above.4.When sorting n records, Insertion sort has worst-case cost:a)O(log n).b)O(n).c)O(n log n).*d) O(n A2)e)O(n!)f)None of the above.5.When sorting n records, Quicksort has worst-case cost:a)O(log n).b)O(n).c)O(n log n).*d) O(n A2)e)O(n!)f)None of the above.6.When sorting n records, Quicksort has average-case cost:a)O(log n).b)O(n).c)) O(n log n).d)O(n A2)e)O(n!)f)None of the above.7.When sorting n records, Mergesort has worst-case cost:a)O(log n).b)O(n).*c) O(n log n).d)O(n A2)e)O(n!)f)None of the above.8.When sorting n records, Radix sort has worst-case cost:a)O(log n).b)O(n).c)O(n log n).d)O(n A2)e)O(n!)15少年易学老难成,一寸光阴不可轻-百度文库*f) None of the above.9.When sorting n records with distinct keys, Radix sort has a lower bound of:a)Omega(log n).b)Omega(n).*c) Omega(n log n).d)Omega(n A2)e)Omega(n!)f)None of the above.10.Any sort that can only swap adjacent records as an average case lower bound of:a)Omega(log n).b)Omega(n).c)Omega(n log n).*d) Omega(n A2)e)Omega(n!)f)None of the above.11.The number of permutations of size n is:a)O(log n).b)O(n).c)O(n log n).d)O(n A2)*e) O(n!)f)None of the above.12.When sorting n records, Selection sort will perform how many swaps in the worst case?a) O(log n).*b) O(n).c)O(n log n).d)O(n A2)e)O(n!)f)None of the above.13.Shellsort takes advantage of the best-case behavior of which sort?*a) Insertion sortb)Bubble sortc)Selection sortd)Shellsorte)Quicksortf)Radix sort16_______________________________ 少年易学老难成,一寸光阴不可轻-百度文库_______________14.A poor result from which step causes the worst-case behavior for Quicksort?*a) Selecting the pivotb)Partitioning the listc)The recursive call15.In the worst case, the very best that a sorting algorithm can do when sorting n records is:a)O(log n).b)O(n).*c) O(n log n).d)O(n A2)e)O(n!)f)None of the above.Chapter 8 File Processing and External Sorting: Instructor's CD questions1.As compared to the time required to access one unit of data frommain memory, accessing one unit of data from disk is:a)10 times faster.b)1000 times faster.c)1,000,000 time faster.d)10 times slower.e)1000 times slower.*f) 1,000,000 times slower.2.The most effective way to reduce the time required by a disk-based program is to:a) Improve the basic operations.*b) Minimize the number of disk accesses.c)Eliminate the recursive calls.d)Reduce main memory use.3.The basic unit of I/O when accessing a disk drive is:a)A byte.*b) A sector.c)A cluster.d)A track.e)An extent.4.The basic unit for disk allocation under DOS or Windows is:a)A byte.b)A sector.*c) A cluster.17少年易学老难成,一寸光阴不可轻-百度文库d) A track.e) An extent.5.The most time-consuming part of a random access to disk is usually: *a) The seek.b)The rotational delay.c)The time for the data to move under the I/O head.6.The simplest and most commonly used buffer pool replacement strategy is:a)First in/First out.b)Least Frequently Used.*c) Least Recently Used.7.The C++ programmer's view of a disk file is most like:a)) An array.b)A list.c)A tree.d)A heap.8.In external sorting, a run is:a)) A sorted sub-section for a list of records.b)One pass through a file being sorted.c)The external sorting process itself.9.The sorting algorithm used as a model for most external sorting algorithms is:a)Insertion sort.b)Quicksort.*c) Mergesort.d) Radix Sort.10.Assume that we wish to sort ten million records each 10 bytes long (for a total file size of 100MB of space). We have working memory of size 1MB, broken into 1024 1K blocks. Using replacement selection and multiway merging, we can expect to sort this file using how many passes through the file?a)About 26 or 27 (that is, log n).b)About 10.c)4.*d) 2.Chapter 9 Searching: Instructor's CD questions18少年易学老难成,一寸光阴不可轻-百度文库1.Which is generally more expensive?a) A successful search.*b) An unsuccessful search.2.When properly implemented, which search method is generally the most efficient for exact-match queries?a)Sequential search.b)Binary search.c)Dictionary search.d)Search in self-organizing lists*e) Hashing3.Self-organizing lists attempt to keep the list sorted by:a) value*b) frequency of record accessc) size of record4.The 80/20 rule indicates that:a) 80% of searches in typical databases are successful and 20% are not.*b) 80% of the searches in typical databases are to 20% of the records.c) 80% of records in typical databases are of value, 20% are not.5.Which of the following is often implemented using a self-organizing list? *a) Buffer pool.b)Linked list.c)Priority queue.6.A hash function must:a)) Return a valid position within the hash table.b)Give equal probability for selecting an slot in the hash table.c)Return an empty slot in the hash table.7.A good hash function will:a)Use the high-order bits of the key value.b)Use the middle bits of the key value.c)Use the low-order bits of the key value.*d) Make use of all bits in the key value.8.A collision resolution technique that places all records directlyinto the hash table is called:a)Open hashing.b)Separate chaining.*c) Closed hashing.d) Probe function.19少年易学老难成,一寸光阴不可轻-百度文库9.Hashing is most appropriate for:a)In-memory applications.b)Disk-based applications.*c) Either in-memory or disk-based applications.10.Hashing is most appropriate for:a)) Range queries.b)Exact-match queries.c)Minimum/maximium value queries.11.In hashing, the operation that will likely require more record accesses is: *a) insertb) deleteChapter 10 Indexing: Instructor's CD questions1.An entry-sequenced file stores records sorted by:a)Primary key value.b)Secondary key value.*c) Order of arrival.d) Frequency of access.2.Indexing is:a) Random access to an array.*b) The process of associating a key with the location of a corresponding data record.c) Using a hash table.3.The primary key is:a)) A unique identifier for a record.b)The main search key used by users of the database.c)The first key in the index.4.Linear indexing is good for all EXCEPT:a)Range queries.b)Exact match queries.*c) Insertion/Deletion.d)In-memory applications.e)Disk-based applications.5.An inverted list provides access to a data record from its:a) Primary key.20______________________________ 少年易学老难成,一寸光阴不可轻-百度文库*b) Secondary key.c) Search key.6.ISAM degrades over time because:a) Delete operations empty out some cylinders.*b) Insert operations cause some cylinders to overflow.c) Searches disrupt the data structure.7.Tree indexing methods are meant to overcome what deficiency in hashing? *a) Inability to handle range queries.。
1.Multiple Choices (20 marks, 2 marks for each)1) In a database system, whose responsibility is it to provide data consistency?A. the database administrator'sB. the DBMS'sC. the user'sD. the application programmer's2) The term logical data independence refers to the ability to changeA. the conceptual schema without changing the external schemas, or the application programsB. the physical schema of the data without changing the external schemas, the conceptual schemas, or the application programsC. the application programs without changing the conceptual schemaD. the data without physically relocating the tables3) A database is needed for which of the following application scenarios?I. A video store that needs to keep track of data about members, about videos carried by the store, about videos rented by members, as well as data concerning borrow-date, return-date, and payment information.II. In the human resources department of a company, information about employees, their titles, their salaries and sick days, and about vacation days taken by each employee.III. A computer-simulated video game which needs to calculate and display, the physical (x, y) location of each actor in the game, the speed with which they are moving at the current instant, the direction in which they are moving, the action they are performing, the angle at which the game-player is viewing the scene.A. I and II onlyB. I onlyC. I and III onlyD. I, II, and III4) Which of the following are usually used to represents ENTITY TYPE in ER modeling.A. verbB. nounC. proposition.D. adjective5) What information is necessary when specifying the structure of a table in a relational schema?A. the name of the table, the names of the table's attributes, the data types of attributes, and the formats of attributesB. the name of the table and the names of the table's attributesC. the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can haveD. the name of the table and the amount of storage space to be allocated to the table6) Which of the following problems can be caused by data redundancy in a relational schema?I. Inefficient use of spaceII. Update anomalies and possible loss of dataIII. Inefficient use of processing timeA. I and II onlyB. II onlyC. I and III onlyD. I, II, and III7) Which of the following are properties of transactions in database systems?I. Atomicity and DurabilityII. Consistency and IsolationIII. Unique and IndependentA. I and II onlyB. I and III onlyC. II and III onlyD. I, II, and III8) Which of the following is true about transactions affecting the consistency of a database?A. A transaction always leaves the database in a consistent state.B. A transaction leaves the database in a consistent state if there is no system crash during the execution of the transaction.C. A transaction leaves the database in a consistent state if the user has not violated any integrity constraints.D. There are no guarantees that transactions will leave the database in a consistent state.9) In a two-phase locking protocol, what happens when a transaction requests a conflicting lock?A. The transaction is aborted immediately.B. The transaction immediately acquires the lock from the current lock-holder.C. The transaction proceeds without acquiring the lock.D. The transaction is blocked to acquire the lock.10) During recovery, which of the following transaction operations has both the before and after images?A. CommitB. InsertC. DeleteD. Update2. Write SQL statements (30 marks, 5 marks for each)Consider a database schema with the following relations:Student (SSN, name);Course (ID, instructorName, title, credits, classroom);Enroll (studentSSN, courseID, score);Write SQL statements in SQL2 to perform the following commands.1)Find SSNs and names of all students who are enrolled in a class taught by ‘Smith’;2)Find SSNs and names of all students who are NOT enrolled in a class taught by ‘Smith’;3)List alphabetically titles of all courses either are taught by teachers whose names begin with “Li”OR are taught in room number 4-456. Do NOT list duplicate titles;4)Find the name of the student who enrolled in the course titled “Database” and get the highest score;5)List all students’ name and their average score;6)Find SSNs and names of all students who are enrolled in at least all classes that the student ‘John’enrolled.3. Database Design (30 marks)Y ou are first required to create a conceptual data model of the data requirements for a company that specializes in IT training and then map the conceptual data model into a relational schema. The Company has 30 instructors and can handle up to 100 trainees per training session. The Company offers five advanced technology courses, each of which is taught by a teaching team of two or more instructors. Each instructor is assigned to a maximum of two teaching teams or may be assigned to do research. Each trainee undertakes one advanced technology course per training session.1) Identify the main entity types for the company.2) Identify the main relationship types and specify the multiplicity for each relationship. State any assumptions you make about the data.3) Using your answers for the previous two to draw a single ER model to represent the data requirements for the company.4) Convert the E-R model into a relational schema using the mapping algorithm specified in this course. Specify key and referential integrity constraints, using directed arcs. Make sure you also identify alternate keys. Label each step of the mapping algorithm.4. Normalization (20 marks)The following table lists dentist/patient appointment information. A patient is given an appointment at a specific date and time with a dentist located at a particular surgery. On each day of patient appointments, a dentist is allocated to a specific surgery for that day.Perform the following tasks:1) The table is susceptible to update anomalies. Provide examples of insertion, deletion, and update anomalies.2) Describe and illustrate the process of normalizing the table to BCNF. State any assumptions you make about the data shown in the table.。
数据库技术试题二、填空题1. 一个类可以从直接的或间接的祖先中继承所有属性和方法。
采用这个方法提高了软件的可重用性。
2. 用树型结构表示实体类型及实体间联系的数据模型称为层次模型。
3. 关系数据库的关系演算语言是以集合操作为基础的DML语言。
4. 在函数信赖中,平凡的函数信赖根据Armstrong推理规则中的自反律就可推出。
5. 分布式数据库中定义数据分片时,必须满足三个条件:完备性条件、重构条件和不相交条件。
6. DB并发操作通常会带来三类问题,它们是丢失更新、不一致分析和读脏数据。
7. 事务必须具有的四个性质是:原子性、一致性、隔离性和持久性。
8. 分布式数据库系统中透明性层次越高,应用程序的编写越简单。
9. 在有泛化/细化联系的对象类型之间,较低层的对象类型称为子类型。
10. 目前数据库领域中最常用的数据模型有层次模型,、网状模型, 、关系模型、面向对象模型。
11. 数据管理技术经历了程序管理阶段、文件管理阶段、数据库系统管理阶段三个阶段。
12. SQL语言集数据查询、数据操纵、、数据定义和数据控制功能于一体。
13. 数据库系统采用的三级模式结构为外模式、、模式、内模式。
14. 两个实体型之间的联系类型有一对一联系(1:1)、一对多联系(1:n)、多对多(m:n)三类。
15. 数据库中专门的关系运算包括选择、投影、连接、除法。
16. 满足第一范式(1NF)的关系模式要求。
17. 如何构造出一个合适的数据逻辑结构是逻辑结构设计主要解决的问题。
18. 当数据库被破坏后,如果事先保存了日志文件和数据库的副本,就有可能恢复数据库。
19. 并发控制操作的主要方法是采用封锁机制,其类型有②排它锁(或 X 锁) ③共享锁(或 S 锁)。
20.在关系模式R(S,SN,D)和K(D,CN,NM)中,R的主码是S,K的主码是D,则D在R中称为外键。
21.对于函数依赖X→Y,如果Y是X的子集,则称X→Y为非平凡函数依赖。
生物信息技术_四川大学中国大学mooc课后章节答案期末考试题库2023年1.PDB库中收录的结构既有实验测得的,也有计算机预测的。
答案:正确2.组学就是在实体名词后加上()后缀。
答案:Omics##%_YZPRLFH_%##omics##%_YZPRLFH_%##OMICS3.生物数据包括DNA数据、RNA数据和()数据。
答案:蛋白质4.BLOSUM是基于远源相关的蛋白所构建的可接受点突变矩阵。
答案:错误5.Blast比对结果中的S值代表了比对相似度得分,E值代表了从数据库中随机抽取一条序列,其得分高于S值的概率,因此S越大,E值越小,说明比对结果越()(填“好”或“坏”)。
答案:好6.常用的蛋白质三级结构预测方法包括从头计算、折叠识别和()。
答案:同源建模7.蛋白质二级结构通常指α螺旋、β()、β转角和无规则卷曲。
答案:折叠8.凝胶电泳可以用于分离蛋白质,质谱技术可以识别蛋白质。
答案:正确9.关于GO(Gene ontology),下列说法错误的是:答案:GO的关系图有双向箭头。
10.当样本Chao1指数较高时,Shannon指数一定较高。
答案:错误11.关于DNA分子进化技术,以下说法错误的是:答案:分子进化关系越近的个体其表观一定越接近。
12.关于利用最大似然法建树,下列说法错误的是:答案:并非序列里的每一个替换都会被考虑。
13.关于扩增子测序,说法正确的是:答案:扩增子序列都位于核糖体DNA中。
_16SrDNA针对细菌,18SrDNA和ITS 序列针对真菌。
_先要把目标片段扩增出来,再进行测序。
14.多序列比对运用局部比对,单序列与数据库比对常运用全局比对。
答案:错误15.以下因素哪些对序列比对结果不会产生重大影响:答案:计算机内存16.Muscle和Clustal 是MEGA软件内置比对软件。
答案:正确17.中心法则“central dogma”不包括以下哪个过程?答案:蛋白质构象的改变18.关于启发式算法,正确的是:答案:启发式算法更适合海量数据的对比。
大学数据库考试题和答案一、单项选择题(每题2分,共20分)1. 数据库管理系统(DBMS)是()。
A. 硬件B. 软件C. 数据D. 文件系统答案:B2. 关系数据库管理系统中的关系是指()。
A. 表B. 视图C. 索引D. 存储过程答案:A3. 数据库系统的核心是()。
A. 数据B. 数据模型C. 数据库管理系统D. 数据库管理员答案:C4. 在关系数据库中,关系至少具有()。
A. 一个属性B. 两个属性C. 三个属性D. 任意数量的属性答案:D5. 数据库设计中,将E-R图转换成关系模式的过程属于()。
A. 需求分析阶段B. 概念性设计阶段C. 逻辑设计阶段D. 物理设计阶段答案:C6. 数据库中实现数据独立性的关键技术是()。
A. 视图B. 索引C. 存储过程D. 触发器答案:A7. SQL语言中,用于创建数据库的命令是()。
A. CREATE TABLEB. CREATE DATABASEC. CREATE INDEXD. CREATE VIEW答案:B8. 在SQL中,用于删除表中数据的命令是()。
A. DELETEB. DROPC. REMOVED. ERASE答案:A9. 数据库的完整性约束包括()。
A. 实体完整性、参照完整性和用户定义的完整性B. 实体完整性、域完整性和用户定义的完整性C. 域完整性、参照完整性和用户定义的完整性D. 实体完整性、参照完整性和域完整性答案:A10. 数据库恢复的基础是()。
A. 数据备份B. 日志文件C. 索引D. 视图答案:B二、填空题(每题2分,共20分)1. 数据库系统由数据库、数据库管理系统、________和________组成。
答案:应用系统,数据库管理员2. 在关系数据库中,一个关系中的每一个列称为一个________。
答案:属性3. 数据库管理系统提供的数据定义语言是________,数据操纵语言是________。
答案:DDL,DML4. 视图是一个________的虚表,其内容由查询定义。
一、单项选择题(.2.道试题, .6.分。
. .1. 在数据库设计器中, 建立两个表之间旳一对多旳联络应当满足旳条件是.)。
A.“一方”表建立主索引或候选索引, “多方”表建立一般索引B.“一方”表建立主索引或候选索引, “多方”表建立一般索引或候选索引C.“一方”表建立主索引或一般索引,“多方”表建立主索引或候选索引D.“一方”表建立主索引或候选索引,“多方”表建立一般索引或候选索引。
2. 在Visua.FoxPr.6.0中, 在两个表旳主索引之间建立旳联络是.)。
A.一对一联络B.一对多联络C.一对一联络与一对多联络都可以D.以上都不对旳3. Visua.FoxPr.6.0中创立当地视图或远程视图旳命令是.)。
A.CREAT.VIEWB.CREAT.SQ.VIEWC.CREAT.A.SELECTD.CREAT.SQ.SELECT4. 在文本框旳属性中要显示目前数据表中旳“姓名”字段, 应设置.)。
A.thisform.Text1.value=姓名B.thisform.Text1.controlsourse=姓名C.thisform.Text1.value=”姓名”D.thisform.Text1.controlsourse=”姓名”5. 在Visua.FoxPr.6..中进行“参照完整性”设计时, 要想设置成: 当更改父表中旳主关键字段或候选字段时, 自动更改所有有关子表记录中旳对应值。
应选择.)。
A.限制B.忽视C.级联D.级联或限制6. 项目管理器中旳“数据”选项卡用于显示和管理.)。
A.数据库、自由表和查询B.表单、报表和标签C.数据库、标签和报表D.表单、报表和查询7. Visua.FoxPr.6.0旳ZAP命令可以删除目前表文献中旳.)。
A.所有记录B.带有删除标识旳记录C.构造D.满足条件旳记录8. 当用鼠标使组合框旳内容发生变化时, 将首先触发.)事件。
A.InteractiveChangeB.ClickC.InitD.DownClick9. 默认状况下旳连接类型是.)。
四川大学计算机(软件)学院工程硕士考试试题(2012——2013学年上学期)课程号:_________课序号:___________课程名称:高级数据库技术任课教师:于中华适用专业:软件工程适用年级:____学生人数:________印题份数:______学号:______姓名:_______考试须知四川大学学生参加由学校组织或由学院承办的各级各类考试,必须严格执行《四川大学考试工作管理办法》和《四川大学考场规则》。
有考试违纪作弊行为的,一律按照《四川大学学生考试违纪作弊处罚规定》进行处理。
四川大学各级各类考试的监考人员,必须严格执行《四川大学考试工作管理办法》、《四川大学考场规则》和《四川大学监考人员职责》。
有违反学校有关规定的,严格按照《四川大教学事故认定及处理办法》进行处理。
题号一二三四五六七八九十平时总分得分考试时间年月日阅卷教师签名一、简答题(每小题2分,共计10分)1、什么叫逻辑数据独立性?2、什么叫超键?3、举例说明什么是多对多的联系?4、关系数据库系统中如何实现实体完整性约束?5、哪五种关系运算是基本的关系运算?二、(20分)假设需要设计有关电影信息的管理系统,需要管理的信息包括:(1)有关电影的信息,包括电影的片名、片长、片子的类型、片子拍摄的年份、参演的演员的信息和制片公司的信息;(2)有关演员的信息,包括姓名、住址、电话等;(3)有关制片公司的信息,包括制片公司名、注册地址、总经理等。
假设每个影片唯一地隶属于一家公司,一家公司可以拥有多部片子;一个演员可以出演多部影片,每个影片包含多个演员。
片名和拍摄年份可以唯一地表示一部片子;演员没有重名的情况;制片公司名也没有重名的情况。
1、设计E-R图;2、将E-R图转换成关系模式,标出主键和外键;3、用CREATE TABLE语句创建所设计的关系表,要定义主键和外键。
三、(20分)设有关系模式R(学号S,课程号C,成绩G,任课教师T,教师电话P)。
2022年四川大学计算机科学与技术专业《数据库原理》科目期末试卷A(有答案)一、填空题1、数据库系统是利用存储在外存上其他地方的______来重建被破坏的数据库。
方法主要有两种:______和______。
2、数据库管理系统的主要功能有______________、______________、数据库的运行管理以及数据库的建立和维护等4个方面。
3、主题在数据仓库中由一系列实现。
一个主题之下表的划分可按______、______数据所属时间段进行划分,主题在数据仓库中可用______方式进行存储,如果主题存储量大,为了提高处理效率可采用______方式进行存储。
4、在关系数据库的规范化理论中,在执行“分解”时,必须遵守规范化原则:保持原有的依赖关系和______。
5、数据库系统在运行过程中,可能会发生各种故障,其故障对数据库的影响总结起来有两类:______和______。
6、设某数据库中有作者表(作者号,城市)和出版商表(出版商号,城市),请补全如下查询语句,使该查询语句能查询作者和出版商所在的全部不重复的城市。
SELECT城市FROM作者表_____SELECT城市FROM出版商表;7、在RDBMS中,通过某种代价模型计算各种查询的执行代价。
在集中式数据库中,查询的执行开销主要包括______和______代价。
在多用户数据库中,还应考虑查询的内存代价开销。
8、在数据库系统封锁协议中,一级协议:“事务在修改数据A前必须先对其加X锁,直到事务结束才释放X锁”,该协议可以防止______;二级协议是在一级协议的基础上加上“事务T在读数据R之前必须先对其加S锁,读完后即可释放S锁”,该协议可以防止______;三级协议是在一级协议的基础上加上“事务T在读数据R之前必须先对其加S锁,直到事务结束后才释放S锁”,该协议可以防止______。
9、若事务T对数据对象A加了S锁,则其他事务只能对数据A再加______,不能加______,直到事务T释放A上的锁。
《数据库系统原理》总复习数学与计算机科学学院编写:颜清数据库系统原理总复习第1章 绪论复习题参考答案1、试述数据、数据库、数据库管理系统、数据库系统的概念。
(3、4、5页)答:描述事物的符号记录称为数据;数据库是长期储存在计算机内的、有组织的、可共享的数据集合;数据库管理系统是位于用户与操作系统之间的一层数据管理软件; 数据库系统是指在计算机系统中引入数据库后的系统,一般由数据库、数据库管理系统(及其开发工具)、应用系统、数据库管理员和用户构成。
2.使用数据库系统有什么好处?(12页)答:数据库系统使信息系统从以加工数据的程序为中心转向围绕共享的数据库为中心的阶段,这样既便于数据的集中管理,又有利于应用程序的研制和维护,提高了数据的利用率和相容性,提高了决策的可靠性。
3.试述文件系统与数据库系统的区别和联系。
(8、9、10页)答:1)数据结构化是数据库与文件系统的根本区别。
在文件系统中,相互独立的文件的记录内部是有结构的,管其记录内部已有了某些结构,但记录之间没有联系。
数据库系统实现整体数据的结构化,是数据库的主要特征之一。
2)在文件系统中,数据的最小存取单位是记录,粒度不能细到数据项。
而在数据库系统中,存取数据的方式也很灵活,可以存取数据库中的某一个数据项、一组数据项一个记录或或一组记录。
3)文件系统中的文件是为某一特定应用服务的,文件的逻辑结构对该应用程序来说是优化的,因此要想对现有的数据再增加一些新的应用会很困难,系统不容易扩充。
而在数据库系统中数据不再针对某一应用,而是面向全组织,具有整体的结构化。
5.试述数据库系统的特点。
(9、10、11页)答:数据结构化;数据的共享性高、冗余度低、易扩充;数据独立性高;数据由DBMS 统一管理和控制。
6.数据库管理系统的主要功能有哪些? (4页)答:数据定义功能、数据操纵功能、数据库的运行管理、数据库的建立和维护功能。
7.试述数据模型的概念(13页)、数据模型的作用、数据模型的三个要素。
(14、15页)答:数据模型(Data Model)也是一种模型,它是现实世界数据特征的抽象。
作用:在数据库中用数据模型来抽象、表示和处理现实世界中的数据和信息。
通俗地讲数据模型就是现实世界的模拟,现有的数据库系统均是基于某种数据模型的。
三个要素:数据模型由数据结构、数据操作和完整性约束三部分组成。
8、概念模型的作用(15页)答:概念模型用于信息世界的建模,是现实世界到信息世界的第一层抽象,是数据库设计人员进行数据库设计的有力工具,也是数据库设计人员和用户之间进行交流的语言,因此概念模型一方面应该具有较强的语义表达能力,能够方便、直接地表达应用中的各种语义知识,另一方面它还应该简单、清晰、易于用户理解。
9、定义并解释概念模型中以下术语(P16页)。
实体、实体型、实体集、属性、码、实体联系图(E-R 图)10.试给出三个实际部门的E_R 图,要求实体型之间具有一对一,一对多,多对多各种不同的联系。
一对一:学员和座位的关系.(满员)11.试给出一个实际部门的E-R 图,要求有三个实体型,而且三个实体型之间有多对多联系。
三个实体型之间的多对多联系和三个实体型两两之间的三个多对多联系等价吗? 为什么 ? (17页)12.学校中有若干系,每个系有若干班级和教研室,每个教研室有若干教员,每个班有若干学生,每个学生选修若干课程,每门课可由若干学生选修。
请用E-R 图画出此学校的概念模型。
(20页例题)13.某工厂生产若干产品,每种产品由不同的零件组成,有的零件可用在不同的产品上。
这些零件由不同的原材料制成,不同零件所用的材料可以相同。
这些零件按所属的不同产品分别放在仓库中,原14.试述层次模型的概念,举出三个层次模型的实例。
(22页)答:层次模型是数据库系统中最早出现的数据模型,层次数据库系统采用层次模型作为数据的组织方式。
层次模型是用树形结构来表示各类实体以及实体间的联系的数据模型。
例题:15.今有一个层次数据库实例,试用子女-兄弟链接法和层次序列链接法画出它的存储结构示意图。
(见P26页图1.23)答: 把满足以下两个条件的基本层次联系集合称为网状模型:(1)允许一个以上的结点无双亲。
(2)一个结点可以有多于一个的双亲。
例: 1) 网状模型的两个结点之间有多种联系2) 学生/课程/选课的网状数据库模式:17.试述网状、层次数据库的优缺点。
(26、30页)答:网状数据模型的优点主要有:(1)能够更为直接地描述现实世界,如一个结点可以有多个双亲。
(2)具有良好的性能,存取效率较高。
网状数据模型的缺点主要有:(1)结构比较复杂,而且随着应用环境的扩大,数据库的结构就变得越来越复杂,不利于最终用户掌握。
(2)其数据定义语言(DDL)、数据操作语言(DML)复杂,用户不容易使用。
(3)数据独立性较差。
由于记录之间联系是通过存取路径实现的,应用程序在访问数据时必须选择适当的存取路径,因此,用户必须了解系统结构的细节,加重了编写应用程序的负担。
从而影响数据独立性。
层次模型的优点主要有:(1)层次数据模型本身比较简单,层次分明,便于在计算机内实现。
(2)在层次数据结构中,从根结点到树中任一结点均存在一条唯一的层次路径,为有效地进行数据操纵提供条件。
(3)由于层次结构规定除根结点外所有结点有且仅有一个双亲,故实体集之间的联系可用双亲结点唯一地表示,并且层次模型中的基本层次联系总是从双亲记录指向子女记录,所以记录类型之间的联系名可省略。
由于实体集间的联系固定,所以层次模型DBMS对层次结构的数据有较高的处理效率。
(4)层次数据模型提供了良好的完整性支持。
(5)实体间联系是固定的,且预先定义好的应用系统,采用层次模型来实现,其性能优于关系模型,不低于网状模型。
可见用层次模型对具有一对多的层次关系的部门描述非常自然、直观,容易理解。
这是层次数据库的突出优点。
层次模型的缺点主要有:(1)现实世界中很多联系是非层次性的,如多对多联系、一个结点具有多个双亲等,层次模型表示这类联系的方法很笨拙,只能通过引入冗余数据(易产生不一致性)或创建非自然的数据组织(引入虚拟结点)来解决。
(2)对插入和删除操作的限制比较多。
(3)查询子女结点必须通过双亲结点。
(4)由于结构严密,层次命令趋于程序化。
18.试述关系模型的概念,定义并解释以下术语:(P31页)(1)关系 (2)属性 (3)域 (4)元组(5)主码 (6)分量 (7)关系模式19.试述关系数据库的特点。
(32页)20.试述数据库系统三级模式结构,这种结构的优点是什么?(33、35页)数据库系统的三级模式结构是指数据库系统是由外模式、模式和内模式三级构成。
数据库系统的三级模式是对数据的三个抽象级别,它把数据的具体组织留给DBMS管理,使用户能逻辑地抽象地处理数据,而不必关心数据在计算机中的具体表示方式与存储方式。
为了能够在内部实现这三个抽象层次的联系和转换,数据库管理系统在这三级模式之间提供了两层映象:●外模式/模式映象●模式/内模式映象正是这两层映象保证了数据库系统中的数据能够具有较高的逻辑独立性和物理独立性。
22.什么叫数据与程序的物理独立性?什么叫数据与程序的逻辑独立性?为什么数据库系统具有数据与程序的独立性? (35、36页)当数据库的存储结构改变了(例如选用了另一种存储结构),由数据库管理员对模式/内模式映象作相应改变,可以使模式保持不变,从而应用程序也不必改变。
保证了程序与数据的物理独立性,简称数据的物理独立性。
当需要改变模式时(例如增加新的关系、新的属性、改变属性的数据类型、改变数据间的联系等),由数据库管理员对各个外模式/模式的映象作相应改变,而使外模式保持不变,从而不必修改或重写应用程序改。
而应用程序是依据数据的外模式编写的,保证了数据与程序的逻辑独立性。
简称数据的逻辑独立性。
特定的应用程序是在外模式描述的数据结构上编制的,它依赖于特定的外模式,与数据库的模式和存储结构独立。
不同的应用程序有时可以共用同一个外模式。
数据库的二级映象保证了数据库外模式的稳定性,从而从底层保证了应用程序的稳定性,除非应用需求本身发生变化,否则应用程序一般不需要修改。
23.试述数据库系统的组成。
(37页)数据库系统一般由数据库、数据库管理系统(及其开发工具)、应用系统、数据库管理员和用户构成24.DBA的职责是什么?(37页)决定数据库中的信息内容和结构、决定数据库的存储结构和存取策略、定义数据的安全性要求和完整性约束条件、监控数据库的使用和运行、数据库的改进和重组重构。
25.系统分析员、数据库设计人员、应用程序员的职责是什么?(39页)系统分析员负责应用系统的需求分析和规范说明,要和用户及DBA相结合,确定系统的硬件软件配置,并参与数据库系统的概要设计。
数据库设计人员负责数据库中数据的确定、数据库各级模式的设计。
数据库设计人员必须参加用户需求调查和系统分析,然后进行数据库设计。
在很多情况下,数据库设计人员就由数据库管理员担任。
应用程序员负责设计和编写应用系统的程序模块,并进行调试和安装。
第1章作业(P41):习题3、10、12、13、15第2章关系数据库复习题参考答案1、试述关系模型的三个组成部分。
(46页)答:关系模型由关系数据结构、关系操作集合和关系完整性约束三部分组成。
2、试述关系数据语言的特点和分类。
(47页)答:关系数据语言可以分为三类:A、关系代数语言。
B、关系演算语言:元组关系演算语言和域关系演算语言。
C、SQL:具有关系代数和关系演算双重特点的语言。
这些关系数据语言的共同特点是,语言具有完备的表达能力,是非过程化的集合操作语言,功能强,能够嵌入高级语言中使用。
2、定义并理解下列术语,说明它们联系与区别:(P46---50页)(1)域,笛卡尔积,关系,元组,属性(2)主码,候选码,外部码(3)关系模式,关系,关系数据库3、试述关系模型的完整性规则(53页),在参照完整性中,为什么外部码属性也可以为空?什么情况下才可以为空?(55页)答:实体完整性规则是指若属性A是基本关系R的主属性,则属性A不能取空值。
(P55页)若属性(或属性组)F是基本关系R的外码,它与基本关系S的主码Ks相对应(基本关系R和S 不一定是不同的关系),则对于R中每个元组在F上的值必须为:或者取空值(F的每个属性值均为空值);或者等于S中某个元组的主码值。
即属性F本身不是主属性,则可以取空值,否则不能取空值。
5.设有一个SPJ数据库,包括S,P,J,SPJ四个关系模式:1)求供应工程J1零件的供应商号码SNO:πSno(σSno=‘J1’(SPJ))2)求供应工程J1零件P1的供应商号码SNO:πSno(σSno=‘J1’∧Pno=‘P1‘(SPJ))3)求供应工程J1零件为红色的供应商号码SNO:πSno(σPno=‘P1‘(σCOLOR=’红‘(P)∞SPJ))4)求没有使用天津供应商生产的红色零件的工程号JNO:πJno(SPJ)- πJNO(σcity=‘天津’∧Color=‘红‘(S∞SPJ∞P)5)求至少用了供应商S1所供应的全部零件的工程号JNO:πJno,Pno(SPJ)÷πPno(σSno=‘S1‘(SPJ))(见P62页例6)6.试述等值连接与自然连接的区别和联系。