版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年语文名家散文欣赏题集文化常识与鉴赏能力训练
- 2026年知识产权保护与管理考试题及答案
- 2026年文化创意产业发展问题研究考试题
- 2026年高考报名流程及注意事项测试题
- 2026年数据结构与算法设计实践操作题库
- 2026年国际认证供应链管理师CSCMP复习资料供应链合规性与风险管理
- 2026年汽车维修技师新能源汽车维修与保养技术试题
- 2026年阿里巴巴客服代表招聘笔试题目
- 2025-2026学年外研版(三起)小学英语六年级下册教学计划及进度表
- 2025年于都县教育局直属学校招聘真题
- 谷雨生物2024环境、社会及管治(ESG)报告
- 2025金风变流器2.0MW故障代码手册V4
- 房地产估价试题及答案
- 龙湖物业培训课件
- 反诈知识竞赛题库附答案(150 题)
- 2025年注册可靠性工程师资格认证考试题库500题(含真题、重点题)
- 个人购房合同样本大全
- T-CBMF 91-2020 T-CCPA 17-2020 城市综合管廊结构混凝土应用技术规程
- 电力配网工程各种材料重量表总
- 抗菌药物临床应用指导原则
- 一点一策模板课件
评论
0/150
提交评论