下载
加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 数据库模拟试题及答案(英文)

数据库模拟试题及答案(英文).doc

数据库模拟试题及答案(英文)

能在一起就是安好
2018-01-07 0人阅读 举报 0 0 暂无简介

简介:本文档为《数据库模拟试题及答案(英文)doc》,可适用于求职/职场领域

数据库模拟试题及答案(英文)ExamofDatabaseTechnologyApplicationsDescribethethreelevelsanddataindependenceWhatarekeyconstraintsandforeignconstraintsExplainLEFTJOIN,OUTERJOINandINNERJOINForthefollowingrelationschemaandsetsofFD’s:Ris(A,B,C,D,E,F,G)withFD’sA>B,B>C,A>E,CD>G)Identifythecandidatekey(s)forR)IdentifythebestnormalformthatRsatisfies)DecomposeitinNFifnecessaryExplaintheACIDpropertiesNotownRecordshasdecidedtostoreinformationaboutmusicianswhoperformonitsalbums(aswellasothercompanydata)inadatabaseThecompanyhaschosentohireyouasadatabasedesigner,EachmusicianthatrecordsatNotownhasanSSN,aname,anaddress,andaphonenumber,EachinstrumentusedinsongsrecordedatNotownhasaname(eg,guitar,synthesizer,flute)andamusicalkey(eg,C,Bflat,Eflat),EachalbumrecordedontheNotownlabelhasatitle,acopyrightdate,aformat(eg,CDorMC),andanalbumidentifier,EachsongrecordedatNotownhasatitleandanauthor,Eachmusicianmayplayseveralinstruments,andagiveninstrumentmaybeplayedbyseveralmusicians,Eachalbumhasanumberofsongsonit,butnosongmayappearonmorethanonealbum,Eachsongisperformedbyoneormoremusicians,andamusicianmayperformanumberofsongs,EachalbumhasexactlyonemusicianwhoactsasitsproducerAmusicianmayproduceseveralalbums,ofcourse)DefiningthecompletedERdiagram)DefininginformationforeachrelationConsiderthefollowingrelationalschemaandgiveTSQLexpressionsforthefollowingqueriesSailors(sid,sname,age)Boats(bid,bname,color)Reservers(sid,bid,day))CreatethetableSailors(sid,sname,age)ItincludesthedomainofvaluesassociatedwitheachattributeandintegrityconstraintsNOTPRIMARYKEYsidINTsnameVARCHAR()NOTageINT<age<)ChangetheattributesnameVARCHAR())DeletealltuplesintheSailorsrelationforsailorswhoseageislessthan)Findthenamesofsailorswhohavereservedaboaton‘’)Findthenamesofsailorswhohavereservedaredboat)Findthenamesofsailorswhohavereservedatleastoneboat)Findthesidofsailorswhohavereservedaredboatandagreenboat)FindthenamesofsailorswhohavereservedallboatsConsidertheBuyscomputerRelationshowninFigureThefirstfourcolumnsshowtheageandsalaryofapotentialcustomerandtheBuyscomputercolumnshowswhetherthepersonbuysacomputerWewanttousethisdatatoconstructadecisiontreethathelpspredictwhetherapersonwillbuyacomputerAgeSalarySubscriptionyouthhighnoyouthhighnomiddleagedhighyesseniormediumyesseniorlowyesseniorlownomiddleagedlowyesyouthmediumnoyouthlowyesseniormediumyesyouthmediumyesmiddleagedmediumyesmiddleagedhighyesseniormediumnoFigureTheBuyscomputerRelationANSWERThethreelevelsarephysicallevel,logicallevelandviewlevelPhysicalleveldescribesallrelationsthatarestoredinthedatabaseLogicallevelsummarizeshowtherelationsareactuallystoredonsecondarystoragedevicesEachviewlevelconsistsofacollectionofoneormoreviewsandrelationsfromtheconceptuallevelThereareactuallytwomappings:theconceptualinternalmappingandtheexternalconceptualmappingTheconceptualinternalmappingliesbetweentheconceptualandinternallevelsIfthestructureofthestoreddatabaseischanged,thentheconceptualinternalmappingmustalsobechangedaccordinglysothattheviewfromtheconceptuallevelremainsconstantItisthismappingthatprovidesphysicaldataindependenceforthedatabaseTheexternalconceptualviewliesbetweentheexternalandconceptuallevelsIfthestructureofthedatabaseattheconceptuallevelischanged,thentheexternalconceptualmappingmustchangeaccordinglysotheviewfromtheexternallevelremainsconstantItisthismappingthatprovideslogicaldataindependenceforthedatabasePrimarykeyconstraintsassurethatthekeysofanytworecordsarenotsameinatableTheprimarykeyconstraintsenforcetheentityintegrityofthetableForeignkeyconstraintscontrolthedatathatcanbestoredintheforeignkeytable,italsocontrolschangestodataintheprimarykeytableThisconstraintenforcesreferentialintegritybyensuringthatchangescannotbemadetodataintheprimarykeytableifthosechangesinvalidatethelinktodataintheforeignkeytableTheLEFTOUTERJOINincludesallrowsinthelefttableintheresults,whetherornotthereisamatchonthejoincolumnintherighttableFULLOUTERJOINincludesallrowsfrombothtables,regardlessofwhetherornottheothertablehasamatchingvalueThisINNERJOINisknownasanequijoinItreturnsallthecolumnsinbothtables,andreturnsonlytherowsforwhichthereisanequalvalueinthejoincolumn)(A,D)istheprimarykeyforR)RNF)R(A,B,E),R(B,C,F),R(C,D,G)Atomicity:ThispropertyguaranteesthatasetofrecordsthatarepartofatransactionisindivisibleThuseitheralloperationsofthetransactionareproperlyreflectedinthedatabaseornoneareConsistency:DatabaseconsistencyisthepropertythateverytransactionseesaconsistentdatabaseinstanceDatabaseconsistencyfollowsfromtransactionatomicity,isolation,andtransactionconsistencyIsolation:Althoughmultipletransactionsmayexecuteconcurrently,eachtransactionmustbeunawareofotherconcurrentlyexecutingtransactionsIntermediatetransactionresultsmustbehiddenfromotherconcurrentlyexecutedtransactionsDurability:Afteratransactioncompletessuccessfully,thechangesithasmadetothedatabasepersist,eveniftherearesystemfailures)pruducealbummcontainmusicianmmmnperformsongplayninstrument)musician(SSN,mname,address,phonenumber)instrument(iname,musicalkey)album(atitle,copyrightdate,format,albumidentifier,SSN)song(stitle,author,atitle)play(SSN,iname)produce(SSN,stitle))CREATETABLESailors(sidINTPRIMARYKEY,snameVARCHAR()NOT,ageINTCHECK(ageBETWWENAND)))ALTERTABLESailorsALTERCOLUMNsnameVARCHAR())DELETEFROMSailorsWHEREage<)SELECTsnameFROMSailorsSJOINReservesRONSsid=RsidWHERErday='')SELECTsnameFROMSailorsSJOINReservesRONSsid=RsidJOINBoatsBONBbid=RbidWHEREcolor='red')SELECTsnameFROMSailorsSJOINReservesRONSsid=Rsid)SELECTsnameFROMSailorsSJOINReservesRONSsid=RsidJOINBoatsBONBbid=RbidWHEREBcolor='red'ANDsidIN(SELECTsidFROMSailorsSJOINReservesRONSsid=RsidJOINBoatsBONBbid=RbidWHEREBcolor='green'))SELECTsnameFROMSailorsSWHERENOTEXISTS(SELECT*FROMBoatsBWHERENOTEXISTS(SELECT*FROMReservesRWHERERbid=BbidANDRsid=Ssid))Info(D)=log()log()=Info(D)=×(log()log())×(log()log())age×(log()log())=Gain(age)=Info(D)Info(D)=ageInfo(D)=×(log()log())×(log()log())salary×(log()log())=Gain(salary)=Info(D)Info(D)=salaryageyouthseniormiddleagedclassclassclasssalarysalarysalaryhighnohighyesmediumyeshighnohighyesmediumyesmediumnomediumyesmediumnomediumyeslowyeslowyeslownolowno

用户评价(0)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

文档小程序码

使用微信“扫一扫”扫码寻找文档

1

打开微信

2

扫描小程序码

3

发布寻找信息

4

等待寻找结果

我知道了
评分:

/9

数据库模拟试题及答案&#40;英文&#41;

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利