




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、习题,单选题:10分 填空题:10分 简答题:12分 关系代数运算:12分 SQL:30分 E-R图与转换:16分 模式分解:10分,上次考试各题型所占分数:,2,Single Choice,The database system provides an abstract view of the data, this is achieved through several level of abstraction, among these levels, the (_) describes part of the logical structure of the database. Physi
2、cal level Logical level View level Application level,C,3,Single Choice,Witch one of the following is not true for schema normalization? (_) In relational model, any legal relation schema must satisfies 1NF For any relation schema, there is always a lossless-join, dependency preserving decomposition
3、into 3NFs Relations with only 3 attributes are automatically in BCNF If , then is a trivial functional dependency,C,4,Fill In the Following Blanks,Database system provides Data Definition Language(DDL) to specify database schema, and (_DML_) to express database queries and updates. Collection of ope
4、rations that form a single logical unit of work in database system are called (_Transaction_).,5,Answer The Following Questions,Briefly describe the difference between database schema and database instance. Briefly describe the difference between tables and views.,6,Relational Algebra,R4 = A ( R ) (
5、 R S ),7,Compose SQL,Consider the database of a clinic described below (the primary keys are underlined): Patient (PatCode, Name, Age, Sex, Street, City, Occupation) Operation (OperCode, PatCode, DoctCode, OperDate,OperTime, Detail) Doctor (DoctCode, Name, Specialty, Age) Diagnosed_By (PatCode, Doct
6、Code, DiagDate, DiagTime, Prescription),8,Compose SQL,Define the relation schema Operation in SQL (indicates Primary Key and Foreign Key) List all patients diagnosed or operated by doctor “smith” Find all doctors who have diagnosed all patients whos age are below 12.,9,Create Table Operation( OperCo
7、de Char(30), PatCode Char(15), DocCode Char(15), DiagDate Date, DiagTime Time, Detail VarChar(255), Primary Key(OperCode), Foreign Key(PatCode) References Patient, Foreign Key(DocCode) References Doctor),1.,Define the relation schema Operation in SQL,10,2.,Using Union,(Select Patient.Name From Docto
8、r, Operation, Patient Where Doctor.DocCode = Operation.DocCode AND Operation.PatCode=Patient.PatCode AND Doctor.Name=Smith) Union (Select Patient.Name From Doctor, Diagnosed_by, Patient Where Doctor.DocCode = Diagnosed_by.DocCode AND Diagnosed_by.PatCode=Patient.PatCode AND Doctor.Name=Smith),List a
9、ll patients diagnosed or operated by doctor “smith”,11,2.,Using Subquery,Select Patient.Name From Patient Where Exists( Select * From Doctor, Operation Where Doctor.DocCode=Operation.DocCode AND Doctor.Name=Smith AND Operation.PatCode=Patient.PatCode) OR Exists( Select * From Doctor, Diagnosed_by Wh
10、ere Doctor.DocCode=Diagnosed_by.DocCode AND Doctor.Name=Smith AND Diagnosed_by.PatCode=Patient.PatCode),List all patients diagnosed or operated by doctor “smith”,12,3.,Using Subquery,Select Doctor.Name From Doctor D Where Not Exists( Select * From Patient P Where Age 12 AND Not Exists( Select * From
11、 Diagnosed_by Where Diagnosed_by.DocCode=D.DocCode AND Diagnosed_by.PatCode=P.PatCode),Find all doctors who have diagnosed all patients whos age are below 12.,13,3.,Using Set Operations,Select Doctor.Name From Doctor D Where Not Exists( (Select Patient.PatCode From Patient Where Patient.Age 12) EXCE
12、PT (Select Diagnosed_by.PatCode From Diagnosed_by Where Diagnosed_by.DocCode=D.DocCode) ),Find all doctors who have diagnosed all patients whos age are below 12.,14,E-R Model,The Chinese Film Institute collects statistics about movies and moviegoers in china. These statistics is stored in a database
13、. This database has the following entity sets -Movies, with attributes movie_id, movie_name, production_year, country. -Movie Theaters, with attributes theater_id, thearter_name, city. -Screen, with attributes screen_id, screen_name. It is a weak entity set, its identifying entity set is Movie Theat
14、ers, its discriminator is screen_id. (movie theater contains one or more screens, where the movies are shown.),15,E-R Model,In addition there are the following relationship sets: -In, The identifying relationship set between Screen and Movie Theaters. -Shows, The movies are showed on different scree
15、ns, and we need to store data about the movie shows that have occurred: which movie that was shown, on which screen, at what time, and how many visitors there were.,16,E-R Model,Design an Entity-Relationship diagram with the given entity sets and relationship sets. Translate the E-R diagram into rel
16、ation schemas.,Chapter7 Relational Database Design,17,Movie,1.,Show,18,Movie(Movie_id, Movie_name, production_year,country),Theater(theater_id, theater_name, city),Screen(theater_id, screen_id, screen_name),Show(movie_id, theater_id, screen_id, date, visitor_number),2.,19,Schema Normalization,Given
17、is the following set of functional dependencies F for a relation schema R: R=A, B, C, D, E, G F=ED, CB, CEG, BA Attribute set (C, E) is the only candidate key of R. Decide whether relation schema R is in BCNF. If it is not, describe why Decompose relations R, if necessary, into a collection of relations that are in BCNF. Make sure to indicate which dependency you
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 5S系列知识介绍
- 山东省济宁市兖州区2025年高三年级模拟考试(一)历史试题含解析
- 山东省招远一中2024-2025学年高三第二次模考历史试题理试题含解析
- 浙江工业大学之江学院《异常心理学》2023-2024学年第二学期期末试卷
- 徽商职业学院《食品质量与安专业全综合实验(实验)》2023-2024学年第一学期期末试卷
- 河南省漯河市重点中学2024-2025学年高考生物试题查漏补缺试题(文理)含解析
- 重庆工信职业学院《定向运动》2023-2024学年第二学期期末试卷
- 贵州装备制造职业学院《卫生管理统计学》2023-2024学年第二学期期末试卷
- 中国民航大学《大学外语四》2023-2024学年第一学期期末试卷
- 湖北省部分高中协作体2025届高三三月联考一模考试语文试题及答案
- 2025年汽车维修技能大赛理论知识考试题库及答案(共450题)
- 2024年南通市公安局苏锡通园区分局招聘警务辅助人员考试真题
- 不良资产处置业务操作流程与财务管理
- 2024-2025学年人教版初中地理七年级下册课件 第10章 第2节 巴西
- 2025届山东省青岛市高三下学期一模英语试题(原卷版+解析版)
- 2025年开封大学单招职业倾向性考试题库含答案
- 2025届福建省厦门市高三第二次质量检测地理试题(原卷版+解析版)
- 车队安全学习培训课件
- 地理视角解读电影《哪吒》-开学第一课-高中地理
- JJF1033-2023计量标准考核规范
- 《儿童代谢综合征临床防治指南(2025)》临床解读
评论
0/150
提交评论