2016华南农业大学数据库考试+答案
数据库选择题与答案

数据库选择题与答案一、选择题1、在关系型数据库中,表中的每一行被称为()A 字段B 记录C 主键D 索引答案:B解释:在关系型数据库中,表中的每一行代表一条具体的数据,被称为记录。
字段是表中的列,主键用于唯一标识表中的记录,索引用于提高数据的查询效率。
2、以下哪种数据库模型不是常见的数据库模型()A 层次模型B 网状模型C 关系模型D 线性模型答案:D解释:常见的数据库模型有层次模型、网状模型和关系模型。
线性模型不是常见的数据库模型。
3、用于在数据库中添加新记录的 SQL 语句是()A INSERTB UPDATEC DELETED SELECT答案:A解释:INSERT 语句用于向表中插入新的记录。
UPDATE 语句用于更新表中的现有记录,DELETE 语句用于删除表中的记录,SELECT 语句用于从表中查询数据。
4、在 SQL 中,用于从表中检索特定列数据的关键字是()A FROMB WHEREC SELECTD ORDER BY答案:C解释:SELECT 关键字用于指定要从表中检索的列。
FROM 关键字用于指定要从哪个表中检索数据,WHERE 关键字用于设置筛选条件,ORDER BY 关键字用于对结果进行排序。
5、数据库中的主键()A 可以重复B 可以为空C 不能重复且不能为空D 可以重复但不能为空答案:C解释:主键是用于唯一标识表中每一行的字段或字段组合,它不能重复且不能为空,以确保数据的唯一性和完整性。
6、以下哪种数据类型可以存储小数()A INTB VARCHARC DECIMALD DATE答案:C解释:INT 是整数类型,VARCHAR 是字符串类型,DATE 是日期类型,DECIMAL 可以用于存储带有固定精度和小数位数的小数。
7、在关系数据库中,实现参照完整性通常使用()A 主键B 外键C 索引D 存储过程答案:B解释:外键用于建立两个表之间的关联,确保数据的参照完整性。
主键用于唯一标识表中的记录,索引用于提高查询效率,存储过程是一组预编译的 SQL 语句。
数据库系统概论试题(附答案)

数据库系统概论试题(附答案)数据库系统概论试题一、(每小题4分,共8分)商店销售商品的数据库,涉及如下数据:商店号、商店名、地址;商品号、商品名、单价;某商店销售某商品的数量和日期。
要求:(1)设计E/R图;(2)转换成关系模型(注明函数依赖)。
—、(每小题4分,共8分)(1)(2)商店(商店号,商店名,地址) 商店号→商店名,地址商店(商品号,商品名,单价) 商品号→商品名,单价销售(商店号,商品号,数量,日期) 商店号,商品号,日期→数量二、(每小题4分,共12分)用SQL的有关语句定义(1)学生关系S(或Student),包括学号SNo、姓名SN、年龄SA、系别SD;(2)课程关系C,包括课程号CNo、课程名CN、任课教师TN;按题2的关系模式,用SQL的有关语句实现 (1)对于学生选课关系SC,授予王小兰查询权限以及对SNo和CNo的插入权限;(2)从学生选课关系SC中,删除李小冬(学生关系中可能有重名)的所有选课。
三、(每小题4分,共8分)(1)CRANT SELECT,INSERT(SNo,CNo)ON SCTO 王小兰;(2)DELETE FROM SCWHERE SNo IN(SELECT SNoFROM SWHERE SN=‘李小冬’);四、(共6分)结合题2的关系模式,用SQL语句查询郑老师讲的每门课的学生平均成绩,输出课程号和平均成绩。
四、(共6分)SELECT CNo,AVG(G)FROM SC,CWHERESC.CNo=C.CNoANDTN LIKE‘郑%’GROUP BY CNo;五、(共12分)有关图书发行的关系模型如下:书店s(书店号SNo,书店名SN,地址A)图书u(书号BNo,书名T,作者N,价格P) 图书馆L(馆号LNo,馆名LN,城市C)图书发行SBL(SNo,LNo,BNo,发行量Q)分别用关系代数和sQL语言表达如下查询:“松鹤图书馆”(馆名)收藏图书的书名和出售该书的书店名。
数据库笔试题及答案

数据库笔试题及答案一、选择题1. 数据库管理系统(DBMS)的主要功能是什么?A. 数据存储B. 数据管理C. 数据维护D. 以上都是答案:D2. 关系数据库中的“关系”指的是什么?A. 数据表之间的关系B. 数据库与操作系统之间的关系C. 数据库与应用程序之间的关系D. 数据库与硬件之间的关系答案:A3. SQL语言是什么?A. 结构化查询语言B. 标准查询语言C. 序列查询语言D. 特殊查询语言答案:A二、填空题4. 数据库设计中的_______范式(NF)是最高的规范化形式,可以消除所有的数据冗余。
答案:第五5. 在SQL中,用于删除表中数据的命令是_______。
答案:DELETE三、简答题6. 简述数据库事务的ACID属性。
答案:数据库事务的ACID属性包括原子性(Atomicity)、一致性(Consistency)、隔离性(Isolation)和持久性(Durability)。
原子性意味着事务中的所有操作要么全部完成,要么全部不完成;一致性确保事务执行后数据库从一个一致的状态转移到另一个一致的状态;隔离性保证并发执行的事务之间不会互相影响;持久性确保一旦事务完成,其结果将永久保存在数据库中。
7. 什么是数据库的索引?它有什么作用?答案:数据库的索引是一种特殊的数据库对象,用于优化查询性能。
索引可以快速定位到表中的特定数据,减少查询时需要扫描的数据量,从而提高查询效率。
四、计算题8. 假设有一个学生表Students,包含字段:学号(ID),姓名(Name),年龄(Age),专业(Major)。
编写一个SQL查询语句,列出所有年龄大于20岁的学生姓名和专业。
答案:```sqlSELECT Name, MajorFROM StudentsWHERE Age > 20;```9. 如果要删除Students表中所有年龄小于18岁的学生记录,应该使用哪个SQL命令?答案:```sqlDELETE FROM StudentsWHERE Age < 18;```五、论述题10. 论述数据库备份和恢复的重要性,并简述常见的备份和恢复策略。
数据库题库及答案精选全文完整版

可编辑修改精选全文完整版数据库题库及答案数据库技术是计算机科学中重要的一部分,广泛应用于各个领域。
为了更好地学习和理解数据库知识,题库是一个非常有用的资源。
本文提供一些常见的数据库题目及其答案,希望对读者的学习和实践有所帮助。
一、选择题1. 在关系数据库中,用于描述记录之间的关系的是:a) 表格b) 行c) 列d) 键答案:a) 表格2. 数据库管理系统(DBMS)的主要功能包括:a) 数据的存储和管理b) 数据的查询和分析c) 数据的备份和恢复d) 数据的安全性控制答案:a) 数据的存储和管理、b) 数据的查询和分析、c) 数据的备份和恢复、d) 数据的安全性控制3. 关系数据库中,用于唯一标识一条记录的属性被称为:a) 主键b) 外键c) 候选键d) 索引答案:a) 主键4. 数据库的范式用于描述数据库的结构是否符合某种规范。
以下哪一项不是数据库的范式:a) 一范式b) 二范式c) 三范式d) 四范式答案:d) 四范式5. 在SQL语句中,用于插入新记录的关键字是:a) SELECTb) UPDATEc) INSERTd) DELETE答案:c) INSERT二、填空题1. 在关系数据库中,每一行都代表一个________。
答案:记录2. 数据库中具有相同属性的记录集合被称为____________。
答案:表3. 在关系数据库中,用于检索某一部分记录的语句是________。
答案:SELECT4. 数据库设计中常用的三个范式依次是一范式、二范式和__________。
答案:三范式5. 数据库表中,用于唯一标识一条记录的属性被称为________。
答案:主键三、应用题1. 请列举至少三种数据库管理系统(DBMS)的类型,并简要描述它们的特点。
答案:关系型数据库管理系统(RDBMS):采用表格的形式组织数据,具有高度结构化和强一致性的特点。
常见的关系型数据库管理系统有MySQL、Oracle、SQL Server等。
[指导]农大远程教育-数据库原理作业答案
![[指导]农大远程教育-数据库原理作业答案](https://img.taocdn.com/s3/m/73406129cf84b9d528ea7abe.png)
[指导]农大远程教育-数据库原理作业答案农大远程教育-数据库原理作业答案数据库原理第1套作业1.数据库系统是指在计算机系统中引入数据库后的系统。
由数据库、数据库管理系统(及其开发工具)、应用系统和( )构成A. 系统分析员B. 程序员C. 数据库管理员(和用户)D. 操作员参考答案:C 您的答案:--------------------------------------------------------------------------------2.数据管理发展的三个阶段中,没有专门的软件对数据进行管理的阶段是( )A. 人工管理阶段B. 文件系统阶段C. 数据库阶段D. 人工管理和文件管理参考答案:A 您的答案:--------------------------------------------------------------------------------3.在数据管理技术的发展过程中,经历了人工管理阶段、文件系统阶段和数据库系统阶段。
在这几个阶段中,数据独立性最高的是( )阶段。
A. 数据库系统B. 文件系统C. 人工管理D. 数据项管理参考答案:A 您的答案:--------------------------------------------------------------------------------4.数据库(DB),数据库系统(DBS)和数据库管理系统(DBMS)之间的关系是( )A. DBS包括DB和DBMSB. DBMS包括DB和DBSC. DB包括DBS和DBMSD. DBS就是DB,也就是DBMS参考答案:A 您的答案:--------------------------------------------------------------------------------5.数据模型的组成要素是(即数据模型的三要素)( )A. 数据结构、数据操作、完整性约束B. 实体、属性、联系C. 字段、元组、码D. 域、关系、分量参考答案:A 您的答案:--------------------------------------------------------------------------------6.数据库管理系统能实现对数据库中数据的查询、插入、修改和删除等操作(这种功能称为( )A. 数据定义功能B. 数据管理功能C. 数据操纵功能D. 数据控制功能参考答案:C 您的答案:--------------------------------------------------------------------------------7.描述数据库全体数据的全局逻辑结构和特性的是( )A. 模式B. 内模式C. 外模式D. 用户模式参考答案:A 您的答案:--------------------------------------------------------------------------------8.数据库系统的数据独立性体现在( )A. 不会因为数据的变化而要求修改应用程序B. 不会因为数据库存储结构与逻辑结构的改变而要求修改应用程序C. 不会因为存储策略的变化而要求修改存储结构D. 不会因为某些存储结构的变化而影响其他的存储结构参考答案:B 您的答案:--------------------------------------------------------------------------------9.要保证数据库的数据独立性,需要修改的是( )A. 模式与外模式B. 模式与内模式C. 三级模式之间的二级映象D. 三级模式参考答案:C 您的答案:--------------------------------------------------------------------------------10.用户或应用程序看到的那部分局部逻辑结构和特征的描述是( ),它是模式的逻辑子集A. 模式B. 物理模式C. 子模式D. 内模式参考答案:C 您的答案:--------------------------------------------------------------------------------11.下述( )不是数据库管理员的职责。
2016sql数据库期末考试题及答案,推荐文档(2021年整理)

2016sql数据库期末考试题及答案,推荐文档(word版可编辑修改)编辑整理:尊敬的读者朋友们:这里是精品文档编辑中心,本文档内容是由我和我的同事精心编辑整理后发布的,发布之前我们对文中内容进行仔细校对,但是难免会有疏漏的地方,但是任然希望(2016sql数据库期末考试题及答案,推荐文档(word版可编辑修改))的内容能够给您的工作和学习带来便利。
同时也真诚的希望收到您的建议和反馈,这将是我们进步的源泉,前进的动力。
本文可编辑可修改,如果觉得对您有帮助请收藏以便随时查阅,最后祝您生活愉快业绩进步,以下为2016sql数据库期末考试题及答案,推荐文档(word版可编辑修改)的全部内容。
一、单选题(共10 道试题,共50 分.)V 1. SQL Server中,保存着每个数据库对象的信息的系统表是(C)。
A. sysdatabasesB. SyscolumnsC. SysobjectsD. Syslogs满分:5 分2. 在存在下列关键字的SQL语句中,不可能出现Where子句的是(D )。
A. UpdateB. DeleteC. InsertD. Alter满分:5 分“age Between 30 and 40”,这个表达式等同于(A ).A. age〉=30 and age<=40B。
age>=30 or age〈=40C. age>30 and age<40D. age〉30 or age<40满分:5 分4. 如果要在一张管理职工工资的表中限制工资的输入范围,应使用(D )约束。
A。
PDRIMARY KEYB。
FOREIGN KEYC. uniqueD. check满分:5 分5. 记录数据库事务操作信息的文件是(D ).B。
索引文件C。
辅助数据文件D. 日志文件满分:5 分6。
要查询XSH数据库CP表中产品名含有“冰箱”的产品情况,可用( C)命令。
华南农业大学(14数学与信息)2016春季计算机组成原理参考答案(A卷)

1华南农业大学期末考试参考答案(A 卷)2015-2016学年第 2学期 考试科目: 计算机组成原理 考试类型:(闭卷)考试 考试时间: 120 分钟一、选择题(本大题共15小题,每小题2分,共30分)二、填空题(本大题共5小题,每题2分,共10分)1. 控制器 , 存储器2. 移码3. (-0.11100)2或(-0.875)104. 64 , 165. 1250H , 读6. 3 , 207. 大 , 独立请求 或 计数器定时查询方式 8. 4 , 2409. add , mov , SRout MARin, MARout, MEMop=read DBUS->MDR->MUX, T+MUX->SR MDRin, MDRout, MUXop=1, ALUop=add三、计算题(本大题共3小题,共24分)1.(9分)解:(C 1890000)16按二进制展开为:1100 0001 1000 1001 0000 0000 0000 0000 (1分)S=1,e=10000011-127=4,M=00010010000000000000000 (3分)所以真值为-1.0001001×24 = -17.125 (2分)(42658000)16和(C 1890000)16的阶码分别为10000100和10000011,按照小阶向大阶看齐原则,将后者阶码调大到等于前者阶码即10000100 (3分)2.(9分)(1)120ns (3分)(2)执行81条指令需要的时间为:120*5+(81-1)*120=1.02*10-5(s)则吞吐率为:81/(1.02*10-5)=7.9*106(条/秒) (3分)(3)顺序执行81条指令需要的时间为:(120+80+100+120+80)*81=4.05*10-5(s)因此加速比为:4.05*10-5/(1.02*10-5)=4.0 (3分)3.(9分)(1)磁道数为:(30/2-14/2)*100=800(道)因此平均找道时间为:(0+800/100) / 2= 4(ms) (3分)(2)平均等待时间为:(0+1/(7200/60)) / 2= 1/240 或0.00417(s) (3分)(3)读取一个扇区的数据传送时间为:512/(512*50*(7200/60))=1/6*10-3或1.7*10-4(s) (3分)注:把磁盘当作非格式化磁盘来算也可以。
2016年10月全国自考《数据库系统原理》真题及详解

2016年10月全国自考《数据库系统原理》真题及详解2016年10月全国自考《数据库系统原理》真题(总分100, 考试时间90分钟)1. 单项选择题1. 造成数据库中的数据不一致的原因是( )A 数据冗余B 数据存储数量太大C 数据相互关系复杂D 数据库安全性差答案:A2. 逻辑模式/内模式映像,保证了数据库的( )A 完整性B 全性C 逻辑独立性D 物理独立性答案:D解析:如果数据库的内模式要修改,即数据库的物理结构有所变化,那么只要对逻辑模式/内模式映像(即"对应性")作相应的修改,可以使逻辑模式尽可能保持不变。
也就是对内模式的修改尽量不影响逻辑模式,当然对于外模式和应用程序的影响更小,这样,我们称数据库达到了物理数据独立性(简称物理独立性)。
3. 数据库系统生存期中,下面不是需求分析阶段工作的是( )A 分析用户活动,产生业务流程图B 确定系统范围,产生系统关联图C 可行性分析D 分析系统数据,产生数据字典答案:C解析:需求分析阶段的工作主要有:(1)分析用户活动,产生业务流程图。
(2)确定系统范围,产生系统关联图。
(3)分析用户活动涉及的数据,产生数据流图。
(4)分析系统数据,产生数据字典。
4. 关系数据库的数据与更新必须遵循三类完整性规则,下列不是其中一项的是( )A 实体完整性规则B 逻辑完整性规则C 参照完整性规则D 用户定义的完整性规则答案:B5. 设关系模式R(ABCDE),F是R上成立的FD集,F={AB→C,CD→E,DE→B},则关系R的候选键是( )A AB ABC ABDD ABE答案:C6. 关于模式分解,下面叙述不正确的是( )A 模式分解能消除数据冗余和操作异常现象B 在分解以后,所有的检索操作可以节省时间C 在分解了的数据库中可以存储悬挂元组,存储泛关系中无法存储的信息D 在有泛关系假设时,对数据库中关系进行自然连接时,可能产生寄生元组,即损失了信息答案:B解析:模式分解以后,检索操作需要做笛卡儿积或连接操作,这将付出时间代价。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
华南农业大学期末考试试卷(A 卷)2015-2016学年第一学期 考试科目: 数据库系统 考试类型:闭卷 考试时间: 120 分钟 学号 姓名 年级专业Question 1: true-false question (30 points) For each of the followingstatements, indicate whether it is TRUE or FALSE (Using T for TRUEand F for FALSE). You will get 1 point for each correct answer, and 0 point for each wrong or blank answer. BE SURE TO WRITE YOUR ANSWER IN THE ANSWER SHEET!1. Database systems are designed for both defining storage structures and providing mechanisms for manipulation of information.2. Comparing with database system, file-processing system has many disadvantages such like data redundancy and consistency, concurrent-access anomalies.3. Physical data independence in database means that the user working on the logical level need know nothing about complexity of the physical level of database.4. The overall design of database is the database schema, while collection of data stored in the database at a particular moment is an instance of the database.5. The Entity-Relationship data model is often used in logicaldesign phase.6.SQL is a relational language that used as both DDL andDML.7.Metadata is data about data that are stored in data dictionary.8. A tuple is also known as a column in database table.9. A relationship in an ER model can has its own attributes.10.C omposite attributes are not allowed in ER model.11.T he closure of a functional dependency set includes allfunctional dependencies in the set.12.D ependency preservation is necessary to a practicaldecomposition algorithm.13.T he most common type of relationship encountered in datamodeling is ternary relationship.14.A relational schema R is in BCNF if domains of all attributesof R are atomic.15.A tuple variable is a variable that stands for a tuple, in otherwords, it is a variable whose domain is the set of all tuples. 16.A foreign key of a relation is a set of attributes (one or more)that allow us to identify a tuple in that relation uniquely. 17.T he set intersection operation can be replacing by a pair ofset-difference operations.18.A ny relation that is not part of the logical model, but is madevisible to a user as a virtual relation, is called a view.19.I n SQL, the outer join operation defines how tuples in eachrelation that do not match any tuple in the other relation are treated.20.T he main database design phase includes requirementanalysis, logical-design and coding phase.21.T he concept “relation” in relation model is exactly the sam eas the concept “entity” in ER model.22.A weak entity set cannot participate in relationships like usualentity sets.23. A functional dependency α→β is trivial if β⊆α.24.A rmstrong‟s axioms are used to calculate the closures ofattribute sets.25.O nce a transaction is defined, it must be at active, partiallycommitted, failed, aborted or committed state.26.S erial executions of transaction can improve throughput andresource utilization while add waiting time.27.A schedule is correct if it is conflict equivalent to a serialschedule, that means it is a serializable schedule.28.2-Phase Locking Protocol ensures serializability and canavoid dead lock.29.I n recovery technology, Log must be written before updatingis written into database.30. C heckpoint is defined to simplify recovery when a system corruption is occurred.Question 2 single-choice question (2 points for each, and 30 points in total) BE SURE TO WRITE YOUR ANSWER IN HE ANSWER SHEET!1. Assume R(a, b) and S(b, c) are two relations.Q1: =()S R c a ,∏, and Q2: =)(,S R c a ⨯∏Which of the followings is correct? A. Q1 and Q2 produce the same answer.B. The answer to Q1 is always contained in the answer to Q2.C. The answer to Q2 is always contained in the answer to Q1.D. Q1 and Q2 produce completely different answers.2. Choose the only one correct expression from the followings: _______.A. (<> some) ≡ inB. (= all) ≡ not inC. (<> all) ≡ not inD. (= some) ≡ not in 3. Let R(x) be the schema of relation R.Q1: SELECT DISTINCT(x) FROM R rrWHERE NOT EXISTS(SELECT * FROM R WHERE x>rr.x); Q2: SELECT MAX(x) FROM R; Then _______ is correct.A. Q1 and Q2 produce the same answer.B. The answer to Q1 is always contained in the answer to Q2.C. The answer to Q2 is always contained in the answer to Q1.D. Q1 and Q2 produce different answers.4. In SQL, a DELETE statement without a WHERE clause: A. delete all data in the table. B. drop the table.C. delete one column in a table.D. Results in a Cartesian product.5. Mapping an E-R diagram into relation schemas can happen in the phase of ______. A. requirement analysis B. logical design C. conceptual design D. physical design6. If the mapping cardinality from entity set S to entity set T is m-n, then an entity of T is associated with ____ entity(entities) of S.A. oneB. at most oneC. at least oneD. none of A,B,C is correct7. Let R(A,B,C,D) be a relation schema, and A →B, C →D, then_____ is wrong. A. AC →BD B. AC →R C. AD →B D. AD →BC8. Let R(A,B,C,D,E) be a relation schema, from the functional dependency set F={A →B, BC →D, C →E}, we can infer that_____. A. AC is a candidate key of R B. BC is a candidate key of R C. CD is a super key of R D. none of the above 9. Relation among Normal Form i s A. 1NF ⊂ 3NF ⊂BCNF B. 3NF ⊂ 1NF ⊂BCNFC. BCNF ⊂ 3NF ⊂1NFD. 1NF ⊂ BCNF ⊂3NF10. Choose the proper choice to make the following query to realize:Find the names of all customers whose street includes the substring “Main”.select customer_name from customer where customer_street __________ A. like …Main \%‟ B. like …_Main_‟ C. like …\Main_‟ D. like …%Main%‟Which of the following functional dependencies does not hold in R? A. A->B B. BC->A C. C->B D. AB->A12. The main purpose of transaction management is to deal with _______ problem(s). A. Concurrency B. Failure C. Memory crash D. both A and B13. If <T i start> and <T i commit> has appeared in the log after the nearest checkpoint to system crash, then transaction T i must be ______ when system recovery. A. undone B. redone C. deleted D. Neither A or B14. If a transaction T i has obtain an shared lock on data item A, then transition T j cannot ______.A. obtain an exclusive lock on data item AB. obtain a shared lock on data item BC. obtain an exclusive lock on data item BD. obtain an shared lock on data item A15. in2PL protocol, at stage, A transaction may not obtain locks, but can release locks.A. Growing phaseB. Shrinking phaseC. CommittedD. AbortedQuestion 3 (13 points) Consider the following database requirement:A laboratory has properties like ID, name, location, rank. A researcher hasproperties like ID, name, age, skill. A research project has properties like ID,name, budget, and year. The above three entities must satisfy some constraints: Each researcher can be unemployed or employed by one laboratory. One laboratory can employ many researchers. And a researcher can only work at a laboratory at a time. If a researcher is employed, his salary needs to be recorded in the database. A laboratory can participate many projects and a project can be shared by many laboratories.(1) Draw ER diagram to illustrate the requirements. And you can make and state necessary assumptions if any. [6 points](2) Translate your ER diagram into relational database schemas, underline primary keys of each relation, and label foreign keys if it has. Be sure using different way to mark primary keys and foreign keys. [4 points](3) write an sql sentence to create table to store information about which project has been shared by which labs. [3 points]Question 4. (16 points) Consider the relational database of a banking enterprise with the following relation schemas, where the primary keys are underlined.branch (branch_name, branch_city, assets)customer (customer_name, customer_street, customer_city)loan (loan_number, branch_name, amount) borrower (customer_name, loan_number)account (account_number, branch_name, balance) depositor (customer_name, account_number)Give an expression in SQL or in relational algebra expression for each of the following queries. 1) To find all loan number for loans made at the Perryridge branch (that is the name of a certain branch) with loan amounts greater than $1000 in SQL and relational algebra . [4 points]2) Find all customers who have both a loan and an account using relational algebra expression . [3 points]3) Find name of all customers who have at least one loan that the values for amount is null. In SQL [3 points]4) Find the names of all branches where the average account balance is more than $1000 in SQL . [3 points]5) Find all customers that live in the same city with branches they open accounts in SQL. [3 points]Question 5 (11 points) Consider a relation R(A, B, C, D, E) with the set of Functional DependenciesF = { A → BD, BC → E, B → D, D → A }1) Give all candidate keys of R. [4 points] 2) Give a canonical cover of F. [3 points]3) Is R in 3NF? explain why if it is or decompose it into 3NF if not. [4 points]华南农业大学期末考试试卷(A 卷-Answer Sheets )2015-2016学年第1 学期 考试科目: Database system 考试类型:(闭卷) 考试时间: 120 分钟 学号 姓名 年级专业Question 1: true-false question (30 points) For each of the followingstatements, indicate whether it is TRUE or FALSE (Using T for TRUEand F for FALSE). You will get 1 point for each correct answer, and 0 point for each wrong or blank answer. BE SURE TO WRITE YOUR ANSWER IN THE ANSWER SHEET!Question 2 single-choice question (30 points, and 2 for each)BE SURE TO WRITE YOUR ANSWER IN THE ANSWER SHEET!Question 3 (13 points) (ANSWER IN NOT UNIQUE )(1) Draw ER diagram to illustrate the requirements. And you can make and state necessary assumptions if any. [6 points] (next page)(2) Translate your ER diagram into relational database schemas, underline primary keys of each relation, and label foreign keys if it has. Be sure using different way to mark primary keys and foreign keys. [4 points] Laboratory (ID, Name, Location,rank)Researcher (ID, Name, birthday, skill, hiretime, salary, lab_id) project ( ID, name, budget, year)participate (proj_id, lab_id, proj_lab_budget, proj_lab_year)Here primary key is underlined, and foreign key is underlined by wavy line.(3) write an sql sentence to create table to store information about which project has been shared by which labs. [3 points] Create table participate (proj_id int,lab_id int, proj_lab_budget real(10,2),proj_lab_year intprimary key (proj_id, lab_id),foreign key proj_id reference project(id),foreign key lab_id reference laboratory(id))Question 4. (16 points) Consider the relational database of a banking enterprise with the following relation schemas, where the primary keys are underlined.branch (branch_name, branch_city, assets)customer (customer_name, customer_street, customer_city)loan (loan_number, branch_name, amount)borrower (customer_name, loan_number)account (account_number, branch_name, balance)depositor (customer_name, account_number)Give an expression in SQL or in relational algebra expression for each of the following queries. (ANSWER IN NOT UNIQUE )1)To find all loan number for loans made at the Perryridge branch (that is the name of a certain branch) with loan amounts greater than $1000in SQL and relational algebra. [4 points]Select loan_number from loan where branch_name=‟Perryridge branch‟ and amount>1000∏ loan_numberσbranch_name=‟ Perryridge branch‟ and amount>1000 ( loan)2)Find all customers who have both a loan and an account using relational algebra expression. [3 points]customer_name ( borrower d epositor)3)Find name of all customers who have at least one loan that the values for amount is null. In SQL [3 points]Select distinct customer_name from loan where amount is null4)Find the names of all branches where the average account balance is more than $1000 in SQL. [3 points]Select branch_name from account group by branch_name having avg(balance)>10005) Find all customers that live in the same city with branches they open accounts in SQL. [3 points]Select customer_name, customer_city from ((customer natural join depositor) natural join account) natural join branch where customer_city= branch_cityQuestion 5 (11 points) Consider a relation R(A, B, C, D, E) with the set of Functional DependenciesF = { A →BD, BC →E, B →D, D →A }1)Give all candidate keys of R. [4 points]AC,BC, DC2)Give a canonical cover of F. [3 points] (ANSWER IN NOT UNIQUE )F c = { A →B, BC →E, B →D, D →A }3)Is R in 3NF? explain why if it is or decompose it into 3NF if not. [4 points](ANSWER IN NOT UNIQUE )No,decompose it into {R1(AB), R2(BCE),r3(BD),R4(DA)}。