华南理工软件学院2015期末考试-数据库系统A卷(共5页)_第1页
华南理工软件学院2015期末考试-数据库系统A卷(共5页)_第2页
华南理工软件学院2015期末考试-数据库系统A卷(共5页)_第3页
华南理工软件学院2015期末考试-数据库系统A卷(共5页)_第4页
华南理工软件学院2015期末考试-数据库系统A卷(共5页)_第5页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、精选优质文档-倾情为你奉上姓名 学号 学院 专业 座位号 ( 密 封 线 内 不 答 题 )密封线线_ _ 诚信应考,考试作弊将带来严重后果! 华南理工大学期末考试数据库系统试卷 (A)注意事项:1. 考前请将密封线内填写清楚; 2. 所有答案请答在答题纸上; 3考试形式:闭卷; 4. 本试卷共 两 大题,满分100分,考试时间120分钟。题 号一二总分得 分评卷人Part I 20 pts. (1pt each) Fill in the blanks with the best answer.1. The collection of information stored in the dat

2、abase at a particular moment is called an _ of the database. The overall design of the data base is called the database _ . 2. A relation schema R is in _ normal from if for all in F+ , at least one of the following holds: is _ ; is a superkey for R ; Each attribute A in is contained in a candidate

3、key for R . 3. Let R be a relation schema , R1 and R2 from a decomposition of R. Decomposition is a _ if for all legal database instances r of R , R1r R2r=r .4. In E-R model , on entity is represented by a set of _ . A _ is an association among several entities .5. Assume relation r has br blocks an

4、d relation s has bs blocks , therefore , in the best case , only _ block transfers would be required for rs .6. An ideal hash function is _ and _ , the former require that each bucket is assigned the same number of search-key values form the set of all possible values. 7. To generate query-evaluatio

5、n plans for an expression we have to generate logically equivalent expressions using _ .8. Consider a B+- tree of order n ,if there are K search-key values in the file , the path form the root to the leaf mode is no longer than _ .9. A transaction has the following properties: _ , _ , isolation and

6、durability.10. When the final statement of a transaction has been executed , the transaction enters the _ committed state . After a transaction has been rolled back and the database has been restored to its previous state , the transaction enter the _ state .11. A schedule S is _ if a transaction Tj

7、 in S needs a data item previously written by a transaction Ti , then the commit operation of Ti appears before the commit operation of Tj .12. _ attribute values or _ attribute values are not atomic .13. A relation schema may have an attribute that corresponds to the primary key of another relation

8、 . The attribute is called a _ . Answer : 1. _ 8. _2. _ 9. _3. _ 10. _4. _ 11. _5. _ 12. _6. _ 13. _7. _Part 80 pts. Answer the following question.1. 16 points Database design: Consider the following conditions i. The STUDENT may be taught by one and only one teacher . The TEACHER may be instructor

9、of one or more STUDENT .ii. The TEACHER may be responsible for one and only one CLASS . The CLASS may be the responsibility of one and only one TEACHER .iii. The CLASS may be made of one of one or more STUDENT . The STUDENT must be a member of one and only one CLASS .iv. The CLASS must have one and

10、only are ROOM . The ROOM may belong to one or more CLASS . Notes : Assume entity CLASS has the following attributes : CID and CNAME , entity ROOM has the following attributes : RID and LOCATION , entity STUDENT has the following attributes : SID , LASTNAME , and FIRSTNAME , entity TEACHER has follow

11、ing attributes : TID ,TEACHERNAME , and TITLE .a) 8 points Construct an E-R diagram showing these relationships .b) 4 points Construct appropriate relation schemas for the above E-R diagrams .c) 4 points Create an index std_index on the student relation with SID as the search_key .2. 6 points In dat

12、abase design , how to represent relationship set as relational schemas ?3. 14 points Let R=( A , B , C ,D , E , F ) be a relation with functional dependency F=ACB , EFAa) 2 points Compute the candidate keys for R ;b) 6 points Is R in 3NF ? If it is , justify your answer . If not , produce a decompos

13、ition of R into 3NF .c) 6 points Is R in BCNF ? If it is , justify your answer . If not , produce a decomposition of R into BCNF . 4. 28 points BOOK ( Bookid , Title , Publishername )BOOK_AUTHORS ( Bookid , Authorname )PUBLISHER ( Publishername , Address , Phone )BOOK_COPIES ( Bookid , Branchid , No

14、_Of_Copies )LIBRARY_BRANCH ( Branchid , Branchname , Address )BOOK_LOANS ( Bookid , Branchid , Cardno , DataOut , Duedata )BORROWER ( Cardno , Name , Address , Phone )a) 3 points Write appropriate SQL DDL statements for declaring the BOOK_AUTHORS relation.b) 6 points Give an expressions in relationa

15、l algebra to express the following queries :Q1: Retrieve the name of all borrowers who do not have any books checked out.Q2: For each book that is loaned out from the “sharpstown” branch and whose DueDate is today , retrieve the book title , the borrowers name , and the borrowers address .c) 16 poin

16、ts Give an expressions in SQL to express the following queries :Q1: How many copies of the book titled The Lost Tribe are owned by the library branch whose name is “sharpstown” ?Q2: For each library branch , retrieve the branch name and that the total number of books loaned out rom that branch .Q3:

17、Retrieve the name , address , and number of books checked out for all borrowers who have more than five books checked out .Q4: For each book authored ( or co-authored ) by “ Stephen King “ , retrieve the title and the number of copies owned by the library branch whose name is “ central ” .d) 3 point

18、s Record the fact that the manager didnt maintain information about the book named “ T&G ” ,i.e. remove information about “ T&G ” .5. 16 points Query Processing , Optimization and Transactiona) 4 points please describe the implementation process of selection operation A=Cr , where r is a relation . A is an attribute and is not a candidate key , r has a primary index on A . If there are n matching records , the B+ tree index is of height h , and each disk block contains at most d recor

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论