华南农业大学期末考试试卷(A)2006数据库答案_第1页
华南农业大学期末考试试卷(A)2006数据库答案_第2页
华南农业大学期末考试试卷(A)2006数据库答案_第3页
华南农业大学期末考试试卷(A)2006数据库答案_第4页
全文预览已结束

付费下载

下载本文档

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

文档简介

华南农业大学期末考试试卷(A卷)d2006学年第一学期考试科目:数据库原理与方法考试类型:(闭卷)考试时间:120分钟参考答案:Question1:Adatabase-managementsystem(DBMS)isacollectionofinterrelateddataandasetofprogramstoaccessthosedata.Metadataisdataaboutdata.TheE-Rdatamodelisawidelyuseddatamodelfordatabasedesign.Itprovidesaconvenientgrapicalrepresentationtoviewdata,relationships,andconstraints.Asuperkeyofanentitysetisasetofoneormoreattributesthat,takencollectivly,allowsustoidentifyuniquelyanentityintheentityset.Suchminnimalsuperkeysarecalledcandidatekeys.Adata-manipulationlanguage(DML)isalanguagethanenablesuserstoaccessormanipulatedata.Adata-definitionlanguage(DDL)isalanguageforspecifyingthedatabaseschemaandaswellasotherpropertiesofthedata.TransactionsarerequiredtohavetheACIDproperties:atomicity,consistency,isolation,anddurability.Atomicityensuresthateitheralltheeffectsoftransactionarereflectedinthedatabase,ornoneare;Consistencyensuresthat,ifthedatabaseisinitiallyconsistent,theexecutionofthetransactionleavesthedatabaseinaconsistentstate.Isolationensuresthatconcurrentlyexecutingtransactionsareisolatedfromonanother.Durablityensuresthat,onceatransactionhasbeencommitted,thattransaction’sudpatesdonotgetlost,evenifthereisasystemfailure.Itisastatewhereneitherofthesetransactionscaneverproceedwithitsnormalexecution.Concurrencyscheduleconsistsofasequenceofinstructionsfromvarioustransactionswhichrunconcurrently.Auniquefixedtimestampisassociatedwitheachtransactioninthesystem.Thetimestampofthetransactiondeterminetheserializabilityorder.Themostwidelyusedstructureforrecordingdatabasemodificationsisthelog.Thelogisasequenceoflogrecords,recordingalltheupdateactivitiesinthedatabase.Question2:a.b:Relationschemas:factory(name,director,location)workshop(wid,director,location,telephone)depositor(did,director,telephone)accessory(aid,weight,price)product(pid,price)worker(worker_id,name,start_date)f_w(name,wid,number)--FKnamereferencefactory--FKwidreferenceworkshopf_d(name,did,number) --FKnamereferencefactory--FKdidreferencedepositorw_a(wid,aid,number)--FKwidreferenceworkshop--FKaidreferenceaccessoryw_p(wid,pid,number)--FKwidreferenceworkshop--FKpidreferenceproductd_a(did,aid,number)--FKdidreferencedepositor--FKaidreferenceaccessoryd_p(did,pid,number)--FKdidreferencedepositor--FKpidreferenceproducta_p(aid,pid,number)--FKaidreferenceaccessory--FKpidreferenceproductw_w(wid,worker_id,number)--FKwidreferenceworkshop--FKworker_idreferenceworkerQuestion3:F={(S#,C#)→G,C#→TN,TN→D}1NF∵Fm={(S#,C#)→G,C#→TN,TN→D}∴P={R1,R2,R3}ThedefinitionofR1,R2andR3is:R1=(S#,C#,G)R2=(C#,TN)R3=(TN,D)Question4:a.∏empnoδpublisher=’McGraw-Hill’(LoanBooks)b.∏name,ageδpublisher=’McGraw-Hill’(EmployeeLoanBooks)c.∏name,officeδpublisher=’McGraw-Hill’∧year>2000(EmployeeLoanBooks)d.∏empno(Loan)-∏empnoδpublisher=’McGraw-Hill’(LoanBooks)Question5:selectavg(price)frommarketm,saless,itemiwherem.mno=s.mnoands.ino=i.inoandm.city=’Guangzhou’andi.ino=’abc2164’andcolor=‘redselectmnofromsaleswhereino=’pc100intersectselectmnofromsaleswhereino=’jk375selectino,iname,colorfromitemwhereinoin(selectinofromsaleswheremno=’rs225’exceptselectinofromsaleswheremno=’az507’)selectino,max(price),min(price)fromsalsegroupbyinohavingmax(price)-min(price)>100Question6:(select*fromr1)union(select*fromr2)(select*fromr1)intersect(select*fromr2)(select*fromr1)except(select*fromr2)selectr1.A,r2.B,r1.Cfromr1,r2wherer1.B=r2.BQuestion7:a.undo-l

温馨提示

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

评论

0/150

提交评论