Test:Semester1FinalExam 1. You Youh hav ave ecr crea eate ted da afu func ncti tion onn nam amed edN NEW EWFU FUNC NC. .Yo You uno now wch chan ange ges som ome eof oft the hef f unctioncode,andtrytorecreatethefunctionbyexecuting: CREATEORREPLACEFUNCTIONnewfunc....; Whathappens? MarkforReview (1)Points Thecommandfailsbecausethefunctionalreadyexists. Thefunctionisautomaticallydroppedandthenrecreated.(*) Thecommandfailsbecauseyoushouldexecute: Thecommandfailsbeca useyoushouldexecute:CREATEANDREPLACE....; CREATEANDREPLACE....; AsecondfunctionnamedNEWFUNC_2iscreated. Thefunctionisdroppedbutnotrecreated.
Correct 2. Whi Which cho of fth the efo foll llow owin ing gbe best std des escr crib ibes esa as sto tore red dfu func ncti tion on ? Ma r k f o r R e v i ew (1)Points Asubprogramthatmustreturnexactlyonevalue.(*) AsubprogramthatmusthaveatleastoneINparameter. AsubprogramthathasnoOUTorINOUTparameters. AsubprogramthatexecutesautomaticallywhenaDMLstatementisexecut Asubprogramthatexecutesautomaticallywhen aDMLstatementisexecute e donatable. Asubprogramwhichinvokesanothersubprogram.
Correct 3. Af Afun unct ctio ion nmu must sth hav ave eat atl lea east sto one neI IN Npa para rame mete ter, r,a and ndm mus us tretu treturn rnexa exactl ctlyo yone neval value. ue. Markf Markfor orRev Review iew (1)Points
True False(*)
Correct 4. ure urean and da afu func ncti tion on? ? (1)Points
Whi Which cho of fth the efo foll llow owin ing gis isa ad dif iffe fere renc nce ebe betw twee een na apr proc oced ed Mark Markf for orR Rev evie iew w
AprocedurecanincludeDMLstatements,butafunctioncannot. AfunctionmusthaveatleastoneINparameter,whileparametersareop AfunctionmusthaveatleastoneINparameter ,whileparametersareopt t ionalforaprocedure. AprocedurecanreturnaBOOLEANdatatype,whi Aprocedurecanreturn aBOOLEANdatatype,whileafunctioncannot. leafunctioncannot. AfunctioncanbeusedinsideaSQLstatement, Afunctioncanbeused insideaSQLstatement,whileaprocedurecannot whileaprocedurecannot. . (*) AprocedurecanincludeanEXCEPTIONsection, Aprocedurecaninclud eanEXCEPTIONsection,whileafunctioncannot. whileafunctioncannot.
Correct 5. You Yout try ryt to ocr crea eate tea af fun unct ctio ion nna name med dMY MYFU FUNC NC. .Th The efu func ncti tion on doesnotcompilecorrectlybecausethereare doesnotcompilecorr ectlybecausethereareerrorsinyourcode.Whic errorsinyourcode.WhichDiction hDiction aryvi aryview ewcan canyo youq uquer ueryt ytos osee eethe theer error rors? s? Markf Markfor orRev Review iew (1)Points USER_SOURCE USER_ERRORS(*) USER_OBJECTS USER_DEPENDENCIES USER_COMPILES
Correct
6. ure urean and da afu func ncti tion on? ? (1)Points
Whi Which cho of fth the efo foll llow owin ing gis isa ad dif iffe fere renc nce ebe betw twee een na apr proc oced ed Mark Markf for orR Rev evie iew w
Functionscannotbenested;procedurescanbe Functionscannotbene sted;procedurescanbenestedtoatleast8leve nestedtoatleast8level l s. Aprocedurecanhavedefaultvaluesforparame Aprocedurecanhaved efaultvaluesforparameters,whileafunctionca ters,whileafunctioncan n not. Anexplicitcursorcanbedeclaredinaproced Anexplicitcursorcan bedeclaredinaprocedure,butnotinafunctio ure,butnotinafunction n . AfunctioncannotbeusedwithinaSQLstatement;aprocedurecanbeus AfunctioncannotbeusedwithinaSQLstateme nt;aprocedurecanbeuse e dwithinSQL. Afunctionmustreturnavalue,aproceduremayormaynot.(*)
Incorrect.RefertoSection9Lesson1. 7. Whe When ncr crea eati ting nga au use serr-de defi fine ned dfu func ncti tion on, ,th the esi size zeo of fth the e returnedvaluesmaybeuptothesizeofanyP returnedvaluesmaybe uptothesizeofanyPL/SQLdatatype.Trueor L/SQLdatatype.TrueorFalse? False? MarkforReview (1)Points True False(*)
Correct 8. Why Whywi will llt the hef fol ollo lowi wing ngs sta tate teme ment ntf fai ail? l? SELECTemployee_id,tax(p_value=>salary) FROMemployees; MarkforReview (1)Points User-definedfunctionsarenotallowedintheSELECTclause Namenotationisnotallowed(*) Thedatatypeforthetaxvariabledoesnotma Thedatatypeforthe taxvariabledoesnotmatchthedatatypeforsal tchthedatatypeforsala a
ry Thestatementwillexecuteandnotfail
Correct 9. The Thef fun unct ctio ion nav avg_ g_an ann_ n_sa sal lre retu turn rns sth the eav aver erag age ean annu nual als sal al aryforaparticulardepartment.Theexampleb aryforaparticulard epartment.Theexamplebelowisavaliduseofof elowisavaliduseofofthisfun thisfun ction.TrueorFalse? SELECTfirst_name,last_name FROMemployees WHEREavg_ann_sal(20)>15000; MarkforReview (1)Points True(*) False
Correct 10. 10.
Exa Exami mine net the hef fol ollo lowi wing ngc cod ode: e:C CRE REAT ATE EPR PROC OCED EDUR URE Epa pare rent nt
ISBEGIN child1; child2; EXCEPTION WHENNO_DATA_FOUNDTHENNULL; ENDparent; NeitherCHILD1norCHILD2hasanexceptionhandler. WhenPARENTisinvoked,CHILD1raisesaNO_DAT WhenPARENTisinvoked ,CHILD1raisesaNO_DATA_FOUNDexception.Whath A_FOUNDexception.Whathappensne appensne xt? MarkforReview (1)Points PARENThandlestheexception,thenCHILD1continuestoexecute. CHILD1endsabruptly.PARENThandlestheexcep CHILD1endsabruptly. PARENThandlestheexceptionandthenends.CHILD tionandthenends.CHILD2 2 doesnotexecute.(*) CHILD1endsabruptly,PARENThandlestheexcep CHILD1endsabruptly, PARENThandlestheexception,thenCHILD2execute tion,thenCHILD2executes s . CHILD1endsabruptly,PARENTalsoendsabruptl CHILD1endsabruptly, PARENTalsoendsabruptlyandreturnsanunhandle yandreturnsanunhandled d exception.
PARENTdoesnotcompilebecauseyoucannotuse PARENTdoesnotcompil ebecauseyoucannotuseNULL;inanexceptionha NULL;inanexceptionhan n dler.
Correct 11.
Youw Youwant antto tore remov movet ethe hepro proced cedure ureNO NO_NE _NEED EDfro fromy myour oursc schem hema. a.You Youex execu ecute: te:
DROPPROCEDUREno_need; WhichDataDictionaryviewsareupdatedautomatically? MarkforReview (1)Points USER_PROCEDURES USER_OBJECTS USER_SOURCE Alloftheabove.(*) Noneoftheabove.
Correct 12. 12.
Exa Exami mine net the hef fol ollo lowi wing ngc cod ode e(t (the hec cod ode eof ofC CHI HILD LD2 2is isn not ots s
hown): CREATEPROCEDUREchild1 ISv_salaryemployees.salary%TYPE; BEGIN SELECTsalaryINTOv_salaryFROMemployees WHEREemployee_id=9999; EXCEPTION WHENNO_DATA_FOUNDTHENNULL; ENDchild1; CREATEPROCEDUREparent ISBEGIN child1; child2; EXCEPTION WHENNO_DATA_FOUNDTHENNULL; ENDparent; Employee_id9999doesnotexist.Whathappens Employee_id9999does notexist.WhathappenswhenPARENTisexecuted? whenPARENTisexecuted? MarkforReview (1)Points
CHILD1handlestheexceptionsuccessfullyandends.PARENTcontinuesto CHILD1handlestheexceptionsuccessfullyand ends.PARENTcontinuesto executeandinvokesCHILD2.(*) CHILD1endsabruptly,PARENThandlestheexcep CHILD1endsabruptly, PARENThandlestheexceptionsuccessfullyandend tionsuccessfullyandends s .CHILD2doesnotexecute. CHILD1endsabruptly,thenPARENTalsoendsabruptlywithanunhandled CHILD1endsabruptly,thenPARENTalsoendsab ruptlywithanunhandlede e xception. PARENThandlestheexception,thenCHILD1resumesexecution. PARENTfailstocompilebecauseyoucannothavethesameexceptionhand PARENTfailstocompilebecauseyoucannothav ethesameexceptionhandl l erintwoseparatesubprograms.
Correct 13. 13. Whe When nmu must stA AUT UTHI HID DCU CURR RREN ENT_ T_US USER ERb be ein incl clud uded edi in nan ana aut uton onom om oustr oustrans ansact action ionsu subpr bprogr ogram? am? Markf Markfor orRev Review iew (1)Points WhendeclaringDefiner'srights WhendeclaringInvoker'srights(*) WhenusingCOMMITorROLLBACK WhenusingGRANTonthesubprogram
Correct 14. 14. How Howd do oyo you usp spec ecif ify yth that aty you ouw wan ant ta apr proc oced edur ure eMY MYPR PROC OCA Ato to use use" "De Defi fine ner' r's sRi Righ ghts ts"? "? Mark Markf for orR Rev evie iew w (1)Points CREATEORREPLACEPROCEDUREmyproca AUTHIDCURRENT_USERIS... CREATEORREPLACEPROCEDUREmyproca AUTHIDOWNERIS... GRANTDEFINERTOmyprocA;
ALTERPROCEDUREmyprocaTODEFINER; Definer'sRightsarethedefault,thereforenoextracodeorcommandsa Definer'sRightsarethedefault,thereforeno extracodeorcommandsar r eneeded.(*)
Correct 15. 15. useInvok useInvoker's er'sRight Rights? s? (1)Points
How Howd do oyo you usp spec ecif ify yth that aty you ouw wan ant ta apr proc oced edur ure eMY MYPR PROC OCA Ato to MarkforR MarkforReview eview
CREATEORREPLACEPROCEDUREmyproca AUTHIDCURRENT_USERIS... (*)
Invoker'sRightsarethedefault,thereforeno Invoker'sRightsaret hedefault,thereforenoextracodeisneeded. extracodeisneeded. GRANTINVOKERTOmyprocA; ALTERPROCEDUREmyprocaTOINVOKER; CREATEORREPLACEPROCEDUREmyproca AUTHIDOWNERIS...
Correct
Section7 (Answerallquestionsinthissection) 16. 16.
Wha What twi will llh hap appe pen nwh when ent the hef fol ollo lowi wing ngc cod ode eis ise exe xecu cute ted? d?
DECLARE e_outer_excepEXCEPTION; BEGIN DECLARE e_inner_excepEXCEPTION; BEGIN RAISEe_outer_excep; END; EXCEPTION WHENe_outer_excepTHEN DBMS_OUTPUT.PUT_LINE('Outerraised'); WHENe_inner_excepTHEN DBMS_OUTPUT.PUT_LINE('Innerraised'); END; MarkforReview
(1)Points Thecodewillfailtocompilebecausee_inner_excepcannotbereference Thecodewillfailtocompilebecausee_inner_ excepcannotbereferenced d intheouterblock.(*) Thecodewillpropagatethee_outer_excepback Thecodewillpropagat ethee_outer_excepbacktothecallingenvironme tothecallingenvironmen n t. Thecodewillexecutesuccessfullyand'Outer Thecodewillexecute successfullyand'OuterRaised'willbedisplayed Raised'willbedisplayed. . Thecodewillfailtocompilebecausee_inner_ Thecodewillfailto compilebecausee_inner_excepwasdeclaredbutne excepwasdeclaredbutnev v erRAISEd.
Correct 17. 17. The There rea are ren no oem empl ploy oyee ees sin ind dep epar artm tmen ent t75 75. .Wh What atw wil ill lbe bed d isplayedwhenthiscodeisexecuted? DECLARE v_last_nameemployees.last_name%TYPE; BEGIN DBMS_OUTPUT.PUT_LINE('A'); BEGIN SELECTlast_nameINTOv_last_name FROMemployeesWHEREdepartment_id=75; DBMS_OUTPUT.PUT_LINE('B'); END; DBMS_OUTPUT.PUT_LINE('C'); EXCEPTION WHENOTHERSTHEN DBMS_OUTPUT.PUT_LINE('D'); END; MarkforReview (1)Points A C D A D (*)
A A B D
Noneoftheabove
Correct 18. 18. Exc Excep epti tion ons sde decl clar ared edi in na abl bloc ock kar are eco cons nsid ider ered edl loc ocal alt to o thatblock thatblock,and ,andglob globalto altoall allitss itssub-bl ub-blocks. ocks.True TrueorF orFalse? alse? MarkforR MarkforReview eview (1)Points True(*) False
Correct 19. 19. Wha What twi will llh hap appe pen nwh when ent the hef fol ollo lowi wing ngc cod ode eis ise exe xecu cute ted? d? DECLARE e_excep1EXCEPTION; e_excep2EXCEPTION; BEGIN RAISEe_excep1; EXCEPTION WHENe_excep1THENBEGIN RAISEe_excep2;END; END; MarkforReview (1)Points Itwillfailtocompilebecauseyoucannothav Itwillfailtocompil ebecauseyoucannothaveasubblockinsideanex easubblockinsideanexc c eptionsection. Itwillfailtocompilebecausee_excep1isou Itwillfailtocompil ebecausee_excep1isoutofscopeinthesubbloc tofscopeinthesubblock k . Itwillfailtocompilebecauseyoucannotdec Itwillfailtocompil ebecauseyoucannotdeclaremorethanoneexcept laremorethanoneexcepti i oninthesameblock. Itwillcompilesuccessfullyandreturnanunhandlede_excep2totheca Itwillcompilesuccessfullyandreturnanunh andlede_excep2tothecal l lingenvironment.(*)
Correct 20. 20. leSe eServ rver ere err rror or? ? (1)Points
Whi Which cho of fth the efo foll llow owin ing gbe best std des escr crib ibes esa ap pre rede defi fine ned dOr Orac ac Mark Markf for orR Rev evie iew w
HasastandardOracleerrornumberbutmustbe HasastandardOracle errornumberbutmustbenamedbythePL/SQLprog namedbythePL/SQLprogr r ammer Isnotraisedautomaticallybutmustbedeclar Isnotraisedautomati callybutmustbedeclaredandraisedexplicitly edandraisedexplicitlyb b ythePL/SQLprogrammer HasastandardOracleerrornumberandastandardnamewhichcanberef HasastandardOracleerrornumberandastand ardnamewhichcanberefe e rencedintheEXCEPTIONsection(*) IsassociatedwithanOracleerrornumberusin Isassociatedwithan OracleerrornumberusingPRAGMAEXCEPTION_INIT gPRAGMAEXCEPTION_INIT
Correct 21. Which Whichof ofth thef efoll ollowi owing ngare areex examp amples lesof ofpr prede edefin fined edOra Oracle cleSe Serve rvere rerro rrors? rs? (Cho (Choos ose eth thre ree. e.) ) Mark Markf for orR Rev evie iew w (1)Points (Chooseallcorrectanswers) TOO_MANY_ROWS(*) NO_DATA_FOUND(*) OTHERS ZERO_DIVIDE(*) E_INSERT_EXCEP
Correct 22. 22. Exa Exami mine net the hef fol ollo lowi wing ngc cod ode. e.W Wha hat tme mess ssag age eor orm mes essa sage ges swi wi llbedisplayedwhenthiscodeisexecuted? DECLARE v_last_nameemployees.last_name%TYPE; v_numberNUMBER:=27; BEGIN v_number:=v_number/0; SELECTlast_nameINTOv_last_nameFROMemployees WHEREemployee_id=999; EXCEPTION WHENNO_DATA_FOUNDTHEN DBMS_OUTPUT.PUT_LINE('Norowswerefound'); WHENZERO_DIVIDETHEN DBMS_OUTPUT.PUT_LINE('Attempttodividebyzero'); WHENOTHERSTHEN
DBMS_OUTPUT.PUT_LINE('Anerroroccurred'); END; MarkforReview (1)Points Norowswerefound Attempttodividebyzero(*) AttempttodividebyzeroNorowswerefound Anerroroccurred Nomessagewillbedisplayed
Correct 23. 23. An Anat atte temp mpt tto toi ins nser ert ta anu null llv val alue uei int nto oa aNO NOT TNU NULL LLt tab able le columnraisesanORA-01400exception.Howcan columnraisesanORA01400exception.Howcanyoucodeanexceptionha youcodeanexceptionhandlerto ndlerto trapt trapthis hisex excep ceptio tion? n? Markf Markfor orRev Review iew (1)Points TestforWHENORA-1400intheexceptionsection. Declareavariablee_null_excepoftypeEXCEPT Declareavariablee_n ull_excepoftypeEXCEPTION,associateitwithOR ION,associateitwithORA A -01400usingaPRAGMAdirective,andtestforWHENe_null_excepinthe -01400usingaPRAGMAdirective,andtestfor WHENe_null_excepintheexception exception section.(*) Declareavariablee_null_excepoftypeVARCHA Declareavariablee_n ull_excepoftypeVARCHAR2,associateitwithORA R2,associateitwithORA01400usingaPRAGMAdirective,andtestforWHENe_null_excepinthee 01400usingaPRAGMAdirective,andtestforW HENe_null_excepintheexception xception section. Declareavariableasfollows:e_null_excepEXCEPTION:=-01400;Thent Declareavariableasfollows:e_null_excepEX CEPTION:=-01400;Thente e stforWHENe_null_excepintheexceptionsection.
Correct 24. 24. Exa Exami mine net the hef fol ollo lowi wing ngc cod ode efr frag agme ment nt. .At AtL Lin ine eA, A,y you ouw wan an ttoraiseanexceptionifthefetchedsalary ttoraiseanexceptio nifthefetchedsalaryvalueisgreaterthan300 valueisgreaterthan30000.Howc 00.Howc anyoudothis? DECLARE v_salaryemployees.salary%TYPE; BEGIN SELECTsalaryINTOv_salaryFROMemployees WHEREemployee_id=100;
IFv_salary>30000THEN --LineA ENDIF; ... MarkforReview (1)Points TestforWHENVALUE_TOO_HIGHintheexceptionsection. UseRAISE_APPLICATION_ERRORtoraiseanexcept UseRAISE_APPLICATION_ ERRORtoraiseanexceptionexplicitly.(*) ionexplicitly.(*) TestforWHENOTHERSintheexceptionsection, TestforWHENOTHERSi ntheexceptionsection,becauseWHENOTHERStrap becauseWHENOTHERStraps s allexceptions. DefineanEXCEPTIONvariableandassociateitwithanOracleServererr DefineanEXCEPTIONvariableandassociateit withanOracleServererro o rnumberusingPRAGMAEXCEPTION_INIT.
Correct 25. 25. How Howc can any you our ret etri riev eve eth the eer erro ror rco code dea and nde err rror orm mes essa sage geo o fanyOrac fanyOracleSe leServer rverexcep exception? tion? MarkforR MarkforReview eview (1)Points ByusingthefunctionsSQLCODEandSQLERRM(*) ByusingthefunctionsSQLCODEandSQLERR ByusingRAISE_APPLICATION_ERROR BydefininganEXCEPTIONvariableandusingPR BydefininganEXCEPTI ONvariableandusingPRAGMAEXCEPTION_INIT AGMAEXCEPTION_INIT
Correct 26. 26. Au Ause serr-de defi fine ned dex exce cept ptio ion nmu must stb be ede decl clar ared eda as sa ava vari riab able le ofdatatypeEXCEPTION.TrueorFalse? ofdatatypeEXCEPTIO N.TrueorFalse? MarkforReview (1)Points True(*) False
Correct
27. 27. Au Ause serr-de defi fine ned dex exce cept ptio ion nca can nbe ber rai aise sed: d: A.Inthedeclarationsection B.Intheexecutablesection C.Intheexceptionsection MarkforReview (1)Points B C AandB BandC(*) AandC
Correct 28. 28. defineder definederrorm rormessag essage? e? (1)Points
Whi Which cho of fth the efo foll llow owin ing gwi will lls suc ucce cess ssfu full lly yre retu turn rna au use serrMarkforR MarkforReview eview
RAISE_APPLICATION_ERROR('ErrorRaised',-22001); RAISE_APPLICATION_ERROR(-20257,'Errorraised');(*) RAISE_APPLICATION_ERROR(-22001,'ErrorRaised'); RAISE_APPLICATION_ERROR('ErrorRaised',-20257);
Correct 29. 29. The There rea are ren no oem empl ploy oyee ees sin ind dep epar artm tmen ent_ t_id id9 99. 9.W Wha hat tou outp tput ut willbedisplayedwhenthefollowingcodeisexecuted? DECLARE v_countNUMBER; BEGIN SELECTCOUNT(*)INTOv_count FROMemployeesWHEREdepartment_id=99; IFv_count=0THEN RAISENO_DATA_FOUND;
DBMS_OUTPUT.PUT_LINE('Noemployeesfound'); ENDIF; EXCEPTION WHENNO_DATA_FOUNDTHEN DBMS_OUTPUT.PUT_LINE('Department99isempty'); END; MarkforReview (1)Points Noemployeesfound NoemployeesfoundDepartment99isempty Department99isempty(*) TheblockwillfailbecauseyoucannotexplicitlyRAISEapredefinedOr Theblockwillfailbecauseyoucannotexplici tlyRAISEapredefinedOra a cleServererrorsuchasNO_DATA_FOUND
Correct 30. 30. Whi Which cho of fth the efo foll llow owin ing gar are ego good odp pra ract ctic ice egu guid idel elin ines esf for or exception exceptionhand handling? ling?(Cho (Chooset osethree. hree.) ) MarkforR MarkforReview eview (1)Points (Chooseallcorrectanswers) Testyourcodewithdifferentcombinationsof Testyourcodewithdi fferentcombinationsofdatatoseewhatpotentia datatoseewhatpotential l errorscanhappen.(*) Useanexceptionhandlerwheneverthereisanypossibilityofanerror Useanexceptionhandlerwheneverthereisany possibilityofanerroro o ccurring.(*) IncludeaWHENOTHERShandlerasthefirsthan IncludeaWHENOTHERS handlerasthefirsthandlerintheexceptionsec dlerintheexceptionsect t ion. Allowexceptionstopropagatebacktothecallingenvironment. Handlespecificnamedexceptionswherepossible,insteadofrelyingon Handlespecificnamedexceptionswherepossibl e,insteadofrelyingonW W HENOTHERS.(*)
Correct 31. Exami Examine nethe thefo follo llowin wingc gcode ode.W .Why hydoe doest sthe heexc except eption ionha handl ndler ernot notfo follo llowg wg oodpracticeguidelines? DECLARE v_salaryemployees.salary%TYPE;
BEGIN SELECTsalaryINTOv_salaryFROMemployees WHEREemployee_id=999; EXCEPTION WHENOTHERSTHEN DBMS_OUTPUT.PUT_LINE('Anerroroccurred'); END; MarkforReview (1)Points YoushouldnotuseDBMS_OUTPUT.PUT_LINEinan YoushouldnotuseDBM S_OUTPUT.PUT_LINEinanexceptionhandler. exceptionhandler. employee_id999doesnotexistintheemployeestable. Theexceptionhandlershouldtestforthename Theexceptionhandler shouldtestforthenamedexceptionNO_DATA_FOUND dexceptionNO_DATA_FOUND. . (*) TheexceptionhandlershouldCOMMITthetransaction.
Correct 32. 32. Whi Which cho of fth the efo foll llow owin ing gis isN NOT OTa an nad adva vant ntag age eof ofi inc nclu ludi ding ng an anex exce cept ptio ion nha hand ndle ler rin ina aP PL/ L/SQ SQL Lbl bloc ock? k? Mark Markf for orR Rev evie iew w (1)Points Protectsthedatabasefromerrors Codeismorereadablebecauseerror-handlingroutinescanbewrittenin Codeismorereadablebecauseerror-handlingr outinescanbewrittenin thesameblockinwhichtheerroroccurred Preventserrorsfromoccurring(*) Avoidscostlyandtime-consumingcorrectionofmistakes
Correct 33. 33. Whi While lea aP PL/ L/SQ SQL Lbl bloc ock kis ise exe xecu cuti ting ng, ,mo more ret tha han non one eex exce cept pt ioncanoccuratthesametime.TrueorFalse? MarkforReview ioncanoccuratthesametime.TrueorFalse? (1)Points True False(*)
Correct
Section8 (Answerallquestionsinthissection) 34. 34. Ap Apro rogr gram amme mer rcr crea eate tes sa aPL PL/S /SQL QLs sub ubpr prog ogra ram mwh whic ich his isc com ompi pi ledandstoredinthedatabase.Twoseparateu ledandstoredinthe database.Twoseparateusersthenexecuteanappl sersthenexecuteanapplicationw icationw hichinvokesthissubprogramfourtimes.Howm hichinvokesthissubp rogramfourtimes.Howmanytimesmustthesubpro anytimesmustthesubprogramber gramber ecomp compil iled ed? ? Mark arkf forR orRev evie iew w (1)Points Twice Fourtimes None(*) Eighttimes Once
Correct 35. 35. The Thef fol ollo lowi wing nga are ret the hes ste teps psi inv nvol olve ved din inc cre reat atin ing, g,a and ndl l atermodifyingandre-creating,aPL/SQLproce atermodifyingandrecreating,aPL/SQLprocedureinApplicationExpre dureinApplicationExpress.Inwh ss.Inwh atsequenceshouldthesestepsbeperformed? Retrievethesavedcodefrom"SavedSQL"inSQLCommands Executethecodetocreatetheprocedure Executethecodetore-createtheprocedure Clickonthe"Save"buttonandsavetheprocedurecode ModifythecodeintheSQLCommandswindow TypetheprocedurecodeintheSQLCommandswindow MarkforReview (1)Points F,C,A,B,E,D F,B,D,A,E,C(*) E,D,F,C,A,B F,B,D,E,A,C
F,B,C,D,E,A
Correct 36. 36.
Wha What tis isa ano noth ther ern nam ame efo for ra ane nest sted eds sub ubpr prog ogra ram? m?
Mark Markfo for r
Review (1)Points Hostedsubprogram Localsubprogram(*) Limitedsubprogram
Correct 37. 37. AP APL/ L/SQ SQL Lst stor ored edp pro roce cedu dure rec can ana acc ccep ept ton one eor orm mor ore ein inpu put t parametersandcanreturnoneormoreoutputvaluestothecallingenvi parametersandcanreturnoneormoreoutputv aluestothecallingenvironment. ronment. TrueorFa TrueorFalse? lse? MarkforR MarkforReview eview (1)Points True(*) False
Correct 38. 38. As Asto tore red dPL PL/S /SQL QLp pro roce cedu dure rec can anb be ein invo voke ked dfr from omw whi hich cho of f thefollowing? APL/SQLanonymousblock AnotherPL/SQLprocedure Acallingapplication MarkforReview (1)Points Aonly AandB AandC
A,BandC(*) BandC
Correct 39. 39. Whi Which cho of fth the efo foll llow owin ing gke keyw ywor ords dsM MUS UST Tbe bei inc nclu lude ded din ine eve ve ryPL/SQLproceduredefinition?(Choosethree. ryPL/SQLprocedurede finition?(Choosethree.) ) MarkforReview (1)Points (Chooseallcorrectanswers) REPLACE BEGIN(*) ISorAS(*) DECLARE END(*)
Correct 40. 40. You Youh hav ave ecr crea eate ted dpr proc oced edur ure eMY MYPR PROC OCw wit ith ha asi sing ngle lep par aram amet et erPARM1NUMBER.Nowyouwanttoaddasecond erPARM1NUMBER.Nowy ouwanttoaddasecondparametertotheprocedur parametertotheprocedure.Which e.Which ofthe ofthefo follo llowin wingw gwill illch chang anget ethe hepro proced cedure uresu succe ccessf ssfull ully? y? Markf Markfor orRev Review iew (1)Points ALTERPROCEDUREmyprocADD(parm2NUMBER); Theprocedurecannotbemodified.Onceaproce Theprocedurecannotb emodified.Onceaprocedurehasbeencreated,th durehasbeencreated,the e numberofparameterscannotbechanged. CREATEORREPLACEPROCEDUREsomeproc (parm1NUMBER,parm2NUMBER); (Youdonotneedtorepeatthedetailedcodeo (Youdonotneedtore peatthedetailedcodeoftheprocedure,onlythe ftheprocedure,onlytheheader) header) REPLACEPROCEDUREsomeproc (parm1NUMBER,parm2NUMBER) IS BEGIN...
CREATEORREPLACEPROCEDUREsomeproc (parm1NUMBER,parm2NUMBER) IS BEGIN...(*)
Correct 41. Youh Youhave avecr creat eated edap aproc rocedu edure renam named edMYP MYPROC ROCth that atacc accept eptst sthre hreeI eINp Npara aramet met ersA,B,andC(allnumbers).Whichofthefo ersA,B,andC(alln umbers).WhichofthefollowingcallstoMYPROCi llowingcallstoMYPROCisNOTcor sNOTcor rect rect? ? Mark Markf for orR Rev evie iew w (1)Points myproc(5,10,20); myproc(a=>5,b=>10,20)(*) myproc(a=>5,b=>10,c=>20) myproc(5,10,c=>20)
Correct
param aramet eter er. . (1)Points
42. 42. Ap Apro roce cedu dure rew wil ill lex exec ecut ute efa fast ster eri if fit ith has asa at tle leas ast ton one e Mark arkf forR orRev evie iew w
True False(*)
Correct 43. Exa Exami mine net the hef fol ollo lowi wing ngp pro roce cedu dure re: : CREATEORREPLACEPROCEDUREsmallproc (p_paramINNUMBER) IS BEGIN.... Theprocedureisinvokedby: DECLARE v_paramNUMBER:=20; BEGIN smallproc(v_param); END;
Whichofthefollowingstatementsistrue? MarkforReview (1)Points p_paramisaparameterandv_paramisanargument p_paramisaformalparameterand20isanactualparameter p_paramisaformalparameterandv_paramisa p_paramisaformalpa rameterandv_paramisanactualparameter(*) nactualparameter(*) p_paramandv_paramarebothformalparameters p_paramandv_paramar ebothformalparameters,while20isanactualp ,while20isanactualpa a rameter p_paramisanactualparameterandv_paramis p_paramisanactualp arameterandv_paramisaformalparameter aformalparameter
Correct 44. 44. edure durep par aram amet eter er? ? (1)Points
Whi Which cho of fth the efo foll llow owin ing gis isN NOT OTc cor orre rect ctc cod odin ing gfo for ra apr proc oc Mark Markf for orR Rev evie iew w
(p_paramINVARCHAR2) (p_paramVARCHAR2) (p_paramVARCHAR2(50))(*) (p_paramemployees.last_name%TYPE) (p_paramINOUTVARCHAR2)
Correct 45. 45.
Wha What tar are eth the ety type peo of fpa para rame mete ter rmo mode des? s?
(1)Points CHARACTER,NUMBER,DATE,BOOLEAN CONSTANT,VARIABLE,DEFAULT
Mark Markfo for rRe Revi view ew
LOCAL,GLOBAL,BOTH IN,OUT,INOUT(*)
Correct 46. 46.
Whi Which chp par aram amet eter erm mod ode eis ist the hed def efau ault lt? ?
Mark Markf for orR Rev evie iew w
(1)Points IN(*) OUT NUMBER VARIABLE CONSTANT
Correct 47. 47. Pro Proce cedu dure reS SOM OMEP EPRO ROC Cha has sfi five vep par aram amet eter ers sna name med dA, A,B B, ,C, C,D D ,Einthatorder.Theprocedurewascalledasfollows: SOMEPROC(10,20,D=>50); HowwasparameterBreferenced? MarkforReview (1)Points Positional(*) Named Acombinationofpositionallyandnamed Acombinationofnamedanddefaulted Defaulted
Correct
48. 48. Pro Proce cedu dure reS SOM OMEP EPRO ROC Cha has sfi five vep par aram amet eter ers sna name med dA, A,B B, ,C, C,D D ,Einthatorder.Theprocedurewascalledasfollows: SOMEPROC(10,20,D=>50); HowwasparameterDreferenced? MarkforReview (1)Points Positionally Named(*) Acombinationofpositionallyandnamed Acombinationofnamedanddefaulted Defaulted
Incorrect.RefertoSection8Lesson3.
Section6 (Answerallquestionsinthissection) 49. 49.
You Youc can anu use se% %RO ROWT WTYP YPE Ewi with tht tab able les san and dvi view ews. s.
Mark Markf for or
Review (1)Points True(*) False
Correct 50. Review (1)Points True(*) False
An AnIN INDE DEX XBY BYT TAB ABLE LEm mus ust tha have vea ap pri rima mary ryk key ey
Mar Markfo kfor r
Correct