上海交通大学数据库原理陆朝俊复习docxWord文件下载.docx

上传人:b****4 文档编号:15940641 上传时间:2022-11-17 格式:DOCX 页数:10 大小:42.01KB
下载 相关 举报
上海交通大学数据库原理陆朝俊复习docxWord文件下载.docx_第1页
第1页 / 共10页
上海交通大学数据库原理陆朝俊复习docxWord文件下载.docx_第2页
第2页 / 共10页
上海交通大学数据库原理陆朝俊复习docxWord文件下载.docx_第3页
第3页 / 共10页
上海交通大学数据库原理陆朝俊复习docxWord文件下载.docx_第4页
第4页 / 共10页
上海交通大学数据库原理陆朝俊复习docxWord文件下载.docx_第5页
第5页 / 共10页
点击查看更多>>
下载资源
资源描述

上海交通大学数据库原理陆朝俊复习docxWord文件下载.docx

《上海交通大学数据库原理陆朝俊复习docxWord文件下载.docx》由会员分享,可在线阅读,更多相关《上海交通大学数据库原理陆朝俊复习docxWord文件下载.docx(10页珍藏版)》请在冰豆网上搜索。

上海交通大学数据库原理陆朝俊复习docxWord文件下载.docx

(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'

(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<

y

(A)兀P.A,Q.D(6.A<

P.B(P°

°

P.C=Q.CQ))

(B)兀P.A,Q.D(6.A<

Q.CandP.C=Q.C(?

XQ))

(C)兀p.a,q.d(6.a<

p.c(P)00Q)

(D)兀p.a,q.d(6.a<

q.c(P°

p.b=q.cQ))

SQL

QI:

SELECTDISTINCTaFROMRWHEREb>

10;

SELECTaFROMRWHEREb>

10GROUPBYa;

ConsiderthefollowingtwoSQLqueriesonrelationsR(a,b)andS(c):

SELECTaFROMR

WHEREb>

ALL(SELECTcFROMS);

ANY(SELECTcFROMS);

(A)Q1andQ2alwaysproducethesameanswer.

(B)TheanswertoQIisalwayscontainedintheanswertoQ2・

GivenR(A,B)={('

a;

10),('

b;

20),('

c'

30)},andexecutethefollowingthreestatements.Whatistheresultofthelaststatement?

createviewVasselectAfromRwhereB>

10;

insertintoVvalues('

cT);

selectcount(*)fromV;

GivenarelationR(x)andtwoqueriesasfollows:

SELECTxFROMR;

(SELECTxFROMR)UNION(SELECTxFROMR);

Inthe3-valuedlogicusedbySQL,supposexhasthevalueNULLandyisTRUE,theresultfor(x>

1)ORyis:

(A)FALSE(B)UNKNOWN(C)TRUE(D)NULL

ConsiderthefollowingtwoSQLqueriesonrelationsR(a?

b)andS(b9c):

(RNATURALFULLOUTERJOINS)

UNION

(RNATURALJOINS);

(RNATURALLEFTOUTERJOINS)

(RNATURALRIGHTOUTERJOINS);

SupposethatrelationR(A,B)has100tuplesandS(B,C)has50tuples.ThenumberoftuplesinRNATURALLEFTOUTERJOINSisatmost:

(A)50(B)100(C)150(D)5000

AssumethatarelationR(a,b)hasnoNULL'

sbutmayhaveduplicates・Comparethefollowingtwoqueries:

SELECTcount(*)FROMRGROUPBYa;

SELECTcount(b)FROMRGROUPBYa;

Inthefollowing,theresultsofQIandQ2shouldbetakentobetheresultofthefinalSELECT*FROMR.Assumethattheschema

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > PPT模板 > 图表模板

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1