上海交通大学数据库原理陆朝俊复习docx.docx
- 文档编号:3029684
- 上传时间:2022-11-17
- 格式:DOCX
- 页数:10
- 大小:42.01KB
上海交通大学数据库原理陆朝俊复习docx.docx
《上海交通大学数据库原理陆朝俊复习docx.docx》由会员分享,可在线阅读,更多相关《上海交通大学数据库原理陆朝俊复习docx.docx(10页珍藏版)》请在冰豆网上搜索。
上海交通大学数据库原理陆朝俊复习docx
ER
f\rg
/\
IfwetranslatethisdiagramtorelationsinthenormalwayforE/Rdiagramsdescribedinthetextbook,whichrelationschemawouldnotbeintheresultingdatabaseschema?
(A)E(a,c,b)(B)S(a,c£g)(C)F(c,d)(D)R(a,c)
Ifweinsteadusedthe“object-oriented"approachtotranslatingthisE/Rdiagramtorelations,howmanyrelationschemawouldbedifferent(whencomparedtotheE/R-to-relationstranslation),eitherintheirschema,ortheirsetoftuples,orboth?
(A)1(B)2(C)3(D)4
(B)
ConvertthefollowingE/Rdiagram(withdetailsomitted)toarelationaldatabaseschemausingtheobject-orientedmethod・Howmanyrelationschemaswillbeproduced?
(Assumethateachentitysethasitsownspecialattributes.)
RelationalTheory
GivenarelationR(A,B,C,D,E)andFDsABtCE,BtD,andDtE,whichofthefollowingFD'scannotbeinferred?
(A)ADtCE(B)BCtD(C)ABtA(D)BtE
GivenarelationR(A,B,C,D)withFD:
AtBC,whichofthefollowingMVD'scannotbeinferred?
(A)AttEC
(B)AttB
(C)AttBD
(D)Noneoftheabove.
SupposewehavearelationR(A,B,C,D,E)andtheFD'sAtDE,DtB,andE—>C.IfweprojectR(andthereforeitsFD,s)ontoschemaS(A,B,C),whatistrueaboutthekey(s)forS?
(A)OnlyABCisakey
(B)OnlyAisakey
(C)OnlyDEisakey
(D)A5B,andCareeachkeys
SupposewearegivenarelationschemaR(A,B,C,D,E)withfunctionaldependenciesAtB,BCtDandEtC.IfweprojectRontoS(B,C,D,E),whichofthefollowingfunctionaldependenciesholdsinSandisnotaBCNFviolationforS?
(A)BCtD(B)BEtD(C)BtE(D)EtC
SupposethatR(A,B,C,D)satisfiesMVD:
AttBanditisknownthatRhastuples(al,bl,cl,dl),(al,b2?
c25d2)?
and(a2,bl,cl,d2)・HowmanytuplesmustRhaveatleast?
(A)3(B)4(C)5(D)6
RelationalalgebraandDatalog
Inthefollowingquestion,assumeRandSarebags,andtheoperatorsarebagoperators.
Q1:
(RUS)-(RAS)
Q2:
(S-R)U(R-S)
(A)QIandQ2producethesameanswer.
(B)TheanswertoQIisalwayscontainedintheanswertoQ2.
(C)TheanswertoQ2isalwayscontainedintheanswertoQI.
(D)QIandQ2producedifferentanswers.
GivenrelationsP(A,B,C)andQ(C,D),whichofthefollowingrelationalalgebraexpressionsisequivalenttothisDatalogrule:
Answer(x,w)P(x,y,z)ANDQ(y,w)ANDx (A)兀P.A,Q.D(6.A (B)兀P.A,Q.D(6.A XQ)) (C)兀p.a,q.d(6.a (D)兀p.a,q.d(6.a SQL QI: SELECTDISTINCTaFROMRWHEREb>10; Q2: SELECTaFROMRWHEREb>10GROUPBYa; (A)QIandQ2producethesameanswer. (B)TheanswertoQIisalwayscontainedintheanswertoQ2. (C)TheanswertoQ2isalwayscontainedintheanswertoQI. (D)QIandQ2producedifferentanswers. ConsiderthefollowingtwoSQLqueriesonrelationsR(a,b)andS(c): QI: SELECTaFROMR WHEREb>ALL(SELECTcFROMS); Q2: SELECTaFROMR WHEREb>ANY(SELECTcFROMS); (A)Q1andQ2alwaysproducethesameanswer. (B)TheanswertoQIisalwayscontainedintheanswertoQ2・ (C)TheanswertoQ2isalwayscontainedintheanswertoQI. (D)Noneoftheabove. GivenR(A,B)={('a;10),('b;20),('c',30)},andexecutethefollowingthreestatements.Whatistheresultofthelaststatement? createviewVasselectAfromRwhereB>10; insertintoVvalues('cT); selectcount(*)fromV; (A)1(B)2(C)3(D)4 GivenarelationR(x)andtwoqueriesasfollows: QI: SELECTxFROMR; Q2: (SELECTxFROMR)UNION(SELECTxFROMR); (A)QIandQ2producethesameanswer. (B)TheanswertoQIisalwayscontainedintheanswertoQ2. (C)TheanswertoQ2isalwayscontainedintheanswertoQI. (D)Noneoftheabove. Inthe3-valuedlogicusedbySQL,supposexhasthevalueNULLandyisTRUE,theresultfor(x>1)ORyis: (A)FALSE(B)UNKNOWN(C)TRUE(D)NULL ConsiderthefollowingtwoSQLqueriesonrelationsR(a? b)andS(b9c): QI: (RNATURALFULLOUTERJOINS) UNION (RNATURALJOINS); Q2: (RNATURALLEFTOUTERJOINS) UNION (RNATURALRIGHTOUTERJOINS); (A)QIandQ2producethesameanswer. (B)TheanswertoQIisalwayscontainedintheanswertoQ2. (C)TheanswertoQ2isalwayscontainedintheanswertoQI. (D)QIandQ2producedifferentanswers. SupposethatrelationR(A,B)has100tuplesandS(B,C)has50tuples.ThenumberoftuplesinRNATURALLEFTOUTERJOINSisatmost: (A)50(B)100(C)150(D)5000 AssumethatarelationR(a,b)hasnoNULL'sbutmayhaveduplicates・Comparethefollowingtwoqueries: QI: SELECTcount(*)FROMRGROUPBYa; Q2: SELECTcount(b)FROMRGROUPBYa; (A)QIandQ2producethesameanswer. (B)TheanswertoQIisalwayscontainedintheanswertoQ2. (C)TheanswertoQ2isalwayscontainedintheanswertoQI. (D)QIandQ2producedifferentanswers. Inthefollowing,theresultsofQIandQ2shouldbetakentobetheresultofthefinalSELECT*FROMR.Assumethattheschema
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 上海交通大学 数据库 原理 陆朝俊 复习 docx
![提示](https://static.bdocx.com/images/bang_tan.gif)