ORACLE PROGRAMMING 11G PL/SQL (X52.9358.001.SU10) > COURSE DOCUMENTS > REVIEW ASSESSMENT: PL/SQL FIRST TEST

Review Assessment: PL/SQL FIRST TEST

User / Mustapha Bermak
Submitted / 7/30/10 5:52 PM
Name / PL/SQL FIRST TEST
Status / Completed
Score / 92 out of 100 points
Time Elapsed / 0 hours, 40 minutes, and 25 seconds out of 1 hours and 15 minutes allowed.
Instructions / This test will consist of 25 questions worth4 points each.
Please answer the questions as if you typed the statements in EXACTLY as you see them. If your answer consists of hyphenated words, just type the two words, do not type the hyphens. Please type all your answers in lower case.
Please write your answers down on a piece of paper with each question number in case there are any discrepancies.
Question 1 / 4 out of 4 points
/ The PL in PL/SQL stands for Practical Language.
Selected Answer: / False
Correct Answer: / False
Question 2 / 4 out of 4 points
/ The variables beloware declared correctly:
DECLARE
v_empdeptno, v_deptdeptno NUMBER(4);
Selected Answer: / False
Correct Answer: / False
Question 3 / 4 out of 4 points
/ The variable below is declared correctly:
DECLARE
v_raise_amt emp.sal%TYPE CONSTANT;
Selected Answer: / False
Correct Answer: / False
Question 4 / 4 out of 4 points
/ v_new_sal is declared correctly:
DECLARE
v_sal NUMBER(7,2);
v_new_sal v_sal;
Selected Answer: / False
Correct Answer: / False
Question 5 / 4 out of 4 points
/ This declaration is correct:
DECLARE
v_sal NUMBER(7,2) = 99999.99;
Selected Answer: / False
Correct Answer: / False
Question 6 / 4 out of 4 points
/ The following IF statement will always return TRUE when placed directly after an implicit cursor.
IF SQL%ISOPEN THEN
END IF;
Selected Answer: / False
Correct Answer: / False
Question 7 / 4 out of 4 points
/ It is legal to use variables in place of the lower_bound and upper_bound numbers, as I did in the following loop:
For i in v_lower..v_upper loop
Selected Answer: / True
Correct Answer: / True
Question 8 / 4 out of 4 points
/ The following block run successfully.
DECLARE
v_loopnumber NUMBER(2);
BEGIN
FOR i IN 1..5 LOOP
INSERT INTO test
VALUES (i, 'this is a loop');
END LOOP;
v_loopnumber := i;
END;
/
Selected Answer: / False
Correct Answer: / False
Question 9 / 4 out of 4 points
/ Which of the following statements is true about implicit cursors:
Selected Answer: / Implicit cursors are used for SQL statements that are not named.
Correct Answer: / Implicit cursors are used for SQL statements that are not named.
Question 10 / 0 out of 4 points
/ You can put an EXIT statement in any kind of loop?
Selected Answer: / False
Correct Answer: / True
Question 11 / 4 out of 4 points
/ You must have an ELSE in an IF statement.
Selected Answer: / False
Correct Answer: / False
Question 12 / 4 out of 4 points
/ Whicih of the following does not happen when a statement is Parsed and Executed:
Selected Answer: / Statistics of the table are stored in the database.
Correct Answer: / Statistics of the table are stored in the database.
Question 13 / 4 out of 4 points
/ What will the following statement evaluate to given v_sal is equal to 7 and v_comm is equal to 35?
IF v_sal > 6 AND v_comm < 30 THEN
Selected Answer: / FALSE
Correct Answer: / FALSE
Question 14 / 4 out of 4 points
/ You've written an exception handler in your block and taken care of several possible exceptions that might happen. You now want to be sure if anything else happens that you haven't covered, it will be taken care of. Complete the WHEN statement so that will happen.
EXCEPTION
...
WHEN ______THEN
Selected Answer: / OTHERS
Correct Answer: / others
Question 15 / 4 out of 4 points
/ Is the assignment statement in this loop legal?
FOR i IN 1..5 LOOP
INSERT INTO test
VALUES (i, 'this is a loop');
i := i + 1; -- is this assignment legal?
END LOOP;
Selected Answer: / NO
Correct Answer: / NO
Question 16 / 4 out of 4 points
/ We learned abouttwo exceptions that could possibly happen when you write a SELECT...INTO statement that you wouldalways want to handle. Give the name ofONE of these exceptions.
Selected Answer: / TOO_MANY_ROWS
Correct Answer: / no_data_found
too_many_rows
Question 17 / 4 out of 4 points
/ What function will return the numeric value associated with the error code for an error that has just happened?
Selected Answer: / SQLCODE
Correct Answer: / sqlcode
Question 18 / 4 out of 4 points
/ What is the Oracle provided procedure you can use when you want explicitly raise and exception and issue your own error message to the user?
Selected Answer: / RAISE_APPLICATION_ERROR
Correct Answer: / raise_application_error
Question 19 / 4 out of 4 points
/ You have an inner block and an outerblock. The outer block started processing first then fell into the inner block. In the inner block an exception happens. Oracle goes to which block to look for the exception handler?
Selected Answer: / INNER BLOCK
Correct Answer: / INNER BLOCK
Question 20 / 4 out of 4 points
/ We learned abouttwo types of commands you can put into a pl/sql block. Name one (do not type spaces if the answer contains more than one word and type the answer in lower case).
Selected Answer: / sqldml
Correct Answer: / dml
pl/sql
plsql
sqldml
Question 21 / 0 out of 4 points
/ Name one function you cannot use in a pl/sql command.
Selected Answer: / group function
Correct Answer: / decode
group
sum
min
max
avg
count
Question 22 / 4 out of 4 points
/ When you use the FOR UPDATE clause in a Select statement, it will lock the rows that are returned.
Selected Answer: / True
Correct Answer: / True
Question 23 / 4 out of 4 points
/ Name three types of loops. Use ONE WORD to name each loop andtype them in in alphabetical order.
Selected Answer: / basic for while
Correct Answer: / basic numeric while
numeric simple while
basic for while
for simple while
Question 24 / 4 out of 4 points
/ We learned the threeTYPES of exceptions,name one type of Exception we learned.If your answer is more than one word DO NOT USE HYPHENS and do not type spaces (just type as one long word).
Selected Answer: / predefined
Correct Answer: / nonpredefined
predefined
userdefined
non predefined
pre defined
user defined
Question 25 / 4 out of 4 points
/ You want to trap an Oracle error that does not have a name, so you must give a name to it. The error number is -60 and you want to name the error sudden_deadlock. Which of the statements below will correctly declare this exception:
Selected Answer: /
sudden_deadlock exception;
pragma exception_init (sudden_deadlock, -60);
Correct Answer: /
sudden_deadlock exception;
pragma exception_init (sudden_deadlock, -60);