PL/SQL Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to PL/SQL. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 2 - What value will be assigned to the variable declared as below −

counter binary_integer;

A - 0

B - 1

C - NULL

D - None of the above.

Answer : C

Answer : B

Explanation

The label should be enclosed by double angle brackets (<< and >>)

Q 5 - What will be printed by the following PL/SQL block?

DECLARE
   a number;
PROCEDURE squareNum(x IN OUT number) IS
BEGIN
  x := x * x;
END; 
BEGIN
   a:= 5;
   squareNum(a);
   dbms_output.put_line(a);
END;

A - 5

B - 10

C - 25

D - 0

Answer : C

Q 7 - Observe the syntax given below −

CREATE [OR REPLACE ] TRIGGER trigger_name 
{BEFORE | AFTER | INSTEAD OF } 
{INSERT [OR] | UPDATE [OR] | DELETE} 
[OF col_name] 
ON table_name 
[REFERENCING OLD AS o NEW AS n] 
[FOR EACH ROW] 
WHEN (condition)  
DECLARE
   Declaration-statements
BEGIN 
   Executable-statements
EXCEPTION
   Exception-handling-statements
END;

Which of the following holds true for the [REFERENCING OLD AS o NEW AS n] clause?

A - This allows you to refer new and old values for various DML statements, like INSERT, UPDATE, and DELETE.

B - OLD and NEW references are not available for table level triggers.

C - You can use them for record level triggers.

D - All of the above.

Answer : D

plsql_questions_answers.htm
Advertisements