db2考试自测题1.docx
《db2考试自测题1.docx》由会员分享,可在线阅读,更多相关《db2考试自测题1.docx(18页珍藏版)》请在冰点文库上搜索。
db2考试自测题1
1)WhichofthefollowingproductsisrequiredtobeinstalledinordertobuildanapplicationonAIX,whichwillaccessaDB2UDBforOS/390database?
a)DB2ConnectPersonalEdition
b)DB2UniversalDatabaseWorkgroupEdition
c)DB2PersonalDeveloper'sEdition
d)DB2UniversalDeveloper'sEdition
2)Whichofthefollowingtoolscanbeusedtocatalogadatabase?
a)Journal
b)AlertCenter
c)LicenseCenter
d)ClientConfigurationAssistant
3)Whichofthefollowingutilitieswouldyouruntoorderdataandreclaimspacefromdeletedrowsinatable:
a)reorg
b)db2look
c)db2move
d)runstats
4)ThepurposeoftheUSEprivilegeisto:
a)querydatainatable.
b)loaddataintoatable.
c)createtableswithinatablespace.
d)createtablespaceswithinadatabase.
5)Whichtwoofthefollowingauthoritiescancreateadatabase?
a)DBADM
b)SYSADM
c)DBCTRL
d)SYSCTRL
e)SYSMAINT
6)Catalogingaremotedatabaseis:
a)PerformedonaPCorUNIXmachinetoidentifytheservertheDB2databasemanagerison.
b)PerformedonaPCorUNIXmachinetoidentifytheDB2databasetousersandapplications.
c)NeverperformedinDB2,asonlyonedatabasepernodeisallowed,socataloginganodeautomaticallycatalogsthedatabaseatthatnode.
d)PerformedonaPCorUNIXmachinetoopenthecatalogsintheDB2databaseandpresentauserwithalistofallaccessibletablesinthatdatabase.
7)Giventhecreatestatements:
CREATEDISTINCTTYPEkphASINTEGERWITHCOMPARISONS
CREATEDISTINCTTYPEmphASINTEGERWITHCOMPARISONS
CREATETABLEspeed_limits
(route_numSMALLINT,
canada_slKPHNOTNULL,
us_slMPHNOTNULL)
Whichofthefollowingisavalidquery?
a)SELECTroute_numFROMspeed_limitsWHEREcanada_sl>80
b)SELECTroute_numFROMspeed_limitsWHEREcanada_sl>kph
c)SELECTroute_numFROMspeed_limitsWHEREcanada_sl>us_sl
d)SELECTroute_numFROMspeed_limitsWHEREcanada_sl>kph(80)
假設您正在撰寫的應用程式須處理不同的貨幣,而您希望確保DB2不允許此類貨幣直接與另一貨幣相比較或進行處理。
請記得,每當您想要比較不同貨幣的價值時,便須執行換算。
因此您定義了所需數目的UDT;每種需要用到的貨幣各有一種UDT:
CREATEDISTINCTTYPEUS_DOLLARASDECIMAL(9,2)
CREATEDISTINCTTYPECANADIAN_DOLLARASDECIMAL(9,2)
CREATEDISTINCTTYPEGERMAN_MARKASDECIMAL(9,2)
8)If,foragiventable,theControlCenterdoesnotshowthechoiceGenerateDDL,whichofthefollowingdescribesthereason?
a)Thetableisasystemobject.
b)Thetableisasummarytable.
c)ThetableisinLOADPENDING.
d)Thetableisareplicatedtable.
e)Thetablewascreatedbyadifferentuser.
9)Giventhetables:
COUNTRY
IDNAMEPERSONCITIES
1Argentina110
2Canada220
3Cuba210
4Germany10
5France75
STAFF
IDLASTNAME
1Jones
2Smith
WhichofthefollowingstatementsremovestherowsfromtheCOUNTRYtable
thathavePERSONSintheSTAFFtable?
a)DELETEFROMcountryWHEREidIN(SELECTidFROMstaff)
b)DELETEFROMcountryWHEREidIN(SELECTpersonFROMstaff)
c)DELETEFROMcountryWHEREpersonIN(SELECTidFROMstaff)
d)DELETEFROMcountryWHEREpersonIN(SELECTpersonFROMstaff)
10)ThetableSTOCKhasthefollowingcolumndefinitions:
typeCHAR
(1)
statusCHAR
(1)
quantityINTEGER
priceDEC(7,2)
ItemsareindicatedtobeoutofstockbysettingSTATUStoNULLandQUANTITYandPRICEtozero.WhichofthefollowingstatementsupdatestheSTOCKtabletoindicatethatalltheitemsexceptforthosewithTYPEof"S"aretemporarilyoutofstock?
a)UPDATEstockSETstatus='NULL',quantity=0,price=0WHEREtype<>'S'
b)UPDATEstockSET(status,quantity,price)=(NULL,0,0)WHEREtype<>'S'
c)UPDATEstockSET(status,quantity,price)=('NULL',0,0)WHEREtype<>'S'
d)UPDATEstockSETstatus=NULL,SETquantity=0,SETprice=0WHEREtype<>'S'
11)WhichofthefollowingproductscanbeusedtostoreimagedatainaDB2database?
a)Net.Data
b)NetSearch
c)DB2AVIExtenders
d)DB2XMLExtenders
e)DB2TextExtenders
12)WhichofthefollowingCANNOThaveanautocommitsetting?
a)EmbeddedSQL
b)TheCommandCenter
c)TheCommandLineProcessor
d)TheDB2CallLevelInterface
13)Whichofthefollowingstatementseliminatesallbutoneofeachsetofduplicaterowsinthefinalresulttable?
a)SELECTUNIQUE*FROMt1
b)SELECTDISTINCT*FROMt1
c)SELECT*FROMDISTINCTT1
d)SELECTUNIQUE(*)FROMt1
e)SELECTDISTINCT(*)FROMt1
14)Giventhetable:
STAFF
IDLASTNAME
1Jones
2Smith
3
WhichofthefollowingstatementsremovesallrowsfromthetablewherethereisaNULLvalueforLASTNAME?
a)DELETEFROMstaffWHERElastnameISNULL
b)DELETEALLFROMstaffWHERElastnameISNULL
c)DELETEFROMstaffWHERElastname='NULL'
d)DELETEALLFROMstaffWHERElastname='NULL'
15)Giventhefollowingtabledefinitions:
DEPARTMENT
deptnoCHAR(3)
deptnameCHAR(30)
mgrnoINTEGER
admrdeptCHAR(3)
EMPLOYEE
empnoINTEGER
firstnameCHAR(30)
midinitCHAR
lastnameCHAR(30)
workdeptCHAR(3)
Whichofthefollowingstatementswilllisteveryemployee'snumberandlastnamewith
theemployeenumberandlastnameoftheirmanager,includingemployeeswithouta
manager?
a)SELECTe.empno,e.lastname,m.empno,m.lastnameFROMemployeeeLEFTINNER
JOINdepartmentINNERJOINemployeemONmgrno=m.empnoONe.workdept=deptno
b)SELECTe.empno,e.lastname,m.empno,m.lastname,FROMemployeeeLEFTOUTERJOIN
departmentINNERJOINemployeemONmgrno=m.empnoONe.workdept=deptno
c)SELECTe.empno,e.lastname,m.empno,m.lastnameFROMemployeeeRIGHTOUTERJOIN
departmentINNERJOINemployeemONmgrno=m.empnoONe.workdept=deptno
d)SELECTe.empno,e.lastname,m.empno,m.lastnameFROMemployeeeRIGHTINNERJOIN
departmentINNERJOINemployeemONmgrno=m.empnoONe.workdept=deptno
16)Giventhefollowingtables:
NAMES
NameNumber
WayneGretzky99
JaromirJagr68
BobbyOrr4
BobbyHull23
BrettHull16
MarioLemieux66
SteveYzerman19
ClaudeLemieux19
MarkMessier11
MatsSundin13
POINTS
NamePoints
WayneGretzky244
JaromirJagr168
BobbyOrr129
BobbyHull93
BrettHull121
MarioLemieux189
PIM
NamePIM
MatsSundin14
BobbyOrr12
MarkMessier32
BrettHull66
MarioLemieux23
JoeSakic94
Whichofthefollowingstatementswilldisplaytheplayer'sNames,numbers,pointsandPIMforallplayerswithanentryinallthreetables?
a)SELECTnames.name,names.number,points.points,pim.pimFROMnamesINNERJOINpoints
ONnames.name=points.nameINNERJOINpimONpim.name=names.name
b)SELECTnames.name,names.number,points.points,pim.pimFROMnamesOUTERJOINpoints
ONnames.name=points.nameOUTERJOINpimONpim.name=names.name
c)SELECTnames.name,names.number,points.points,pim.pimFROMnamesLEFTOUTERJOIN
pointsONnames.name=points.nameLEFTOUTERJOINpimONpim.name=names.name
d)SELECTnames.name,names.number,points.points,pim.pimFROMnamesRIGHTOUTERJOIN
pointsONnames.name=points.nameRIGHTOUTERJOINpimONpim.name=names.name
17)Giventhetables:
EMPLOYEE
emp_numemp_namedept
1Adams1
2Jones1
3Smith2
4Williams1
DEPT
dept_iddept_name
1Planning
1Support
andthestatement:
ALTERTABLEemployee
ADDFOREIGNKEY(dept)REFERENCES(dept_id)
ONDELETECASCADE
Howmanyunitsofworkwillbeneededtoprocessthisstatement:
DELETEFROMdeptWHEREdept_id=1
a)0
b)1
c)2
d)3
e)4
f)6
18.Giventherequirementstostorenames,employeenumbers,andwhentheemployeeswerehired,whichofthefollowingDB2datatypesCANNOTbeusedtocontainthedaytheemployeewashired?
a)CLOB
b)TIME
c)VARCHAR
d)TIMESTAMP
19)Giventhetransaction:
"CREATETABLEt1(idINTEGER,CONSTRAINTchkidCHECK(id<100))"
"INSERTINTOt1VALUES(100)"
"COMMIT"
Whichofthefollowingresultsfromthetransaction?
a)TherowisinsertedwithaNULLvalue
b)Therowisinsertedwithavalueof100
c)Therowinsertionwithavalueof100isrejected
d)Thetriggercalledchkidisfiredtovalidatethedata
20)Ifatableisdefinedwithacheckconstraintforoneormorecolumns,whichofthefollowingwillperformthedatavalidationafterthetableisloadedwiththeloadutility.
a)Reorg
b)Check
c)Runstats
d)ImageCopy
e)SetIntegrity
21)Giventhestatement:
CREATEVIEWv1ASSELECTc1FROMt1WHEREc1='a'WITHCHECKOPTION
WhichofthefollowingSQLstatementswillinsertdataintothetable?
a)INSERTINTOv1VALUES(a)
b)INSERTINTOv1VALUES(b)
c)INSERTINTOv1VALUES('b')
d)INSERTINTOv1VALUES('a')
e)INSERTINTOv1VALUES('ab')
22)Anupdatelockgetsreleasedbyanapplicationusingtherepeatablereadisolationlevelduringwhichofthefollowing?
a)Ifthecursoraccessingtherowisclosed.
b)IfthetransactionissuesaROLLBACKstatement.
c)Ifthecursoraccessingtherowismovedtothenextrow.
d)IfthetransactionchangesaremadeviaanUPDATEstatement.
23)Whichofthefollowingisolationlevelsismostlikelytoacquireatablelevellockduringanindexscan?
a)ReadStability
b)RepeatableRead
c)CursorStability
d)UncommittedRead
24)Whichofthefollowingreleasesalockbyanapplicationusingthecursorstabilityisolationlevel?
a)Ifthecursoraccessingtherowismovedtothenextrow
b)Ifthecursoraccessingtherowisusedtoupdatetherow
c)Iftheapplication'scurrentrowisdeletedbytheapplication
d)Iftheapplication'scurrentrowneedstobeupdatedbyanotherapplic
ation
25)WhichofthefollowingprocessesisNOTperformedbyDB2WarehouseManager?
a)Query
b)Loading
c)Extraction
d)Transformation
26)WhichofthefollowingDB2