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 3 - What is wrong in the following code snippet?

DECLARE
   x number := 1;
BEGIN
   LOOP
      dbms_output.put_line(x);
      x := x + 1;
      IF x > 10 THEN
         exit;
      END IF;
     dbms_output.put_line('After Exit x is: ' || x);
END;

A - There is nothing wrong.

B - The IF statement is not required.

C - There should be an END LOOP statement.

D - The exit statement should be in capital letters.

Answer : C

Q 4 - Consider the following code snippet: what will be the output?

DECLARE
   a number(2) ;
BEGIN
   FOR a IN REVERSE 10 .. 20 LOOP
   END LOOP;
dbms_output.put_line(a);
END;

A - 11

B - 10

C - 29

D - 30

Answer : B

Q 5 - Which of the following is a way of passing parameters to PL/SQL subprograms?

A - Positional notation

B - Named notation

C - Mixed notation

D - All of the above.

Answer : D

Q 6 - Which of the following code will successfully declare an exception named emp_exception1 in a PL/SQL block?

A - EXCEPTION emp_exception1;

B - emp_exception1 EXCEPTION;

C - CREATE EXCEPTION emp_exception1;

D - CREATE emp_exception1 AS EXCEPTION;

Answer : B

Q 8 - All objects placed in a package specification are called

A - Public objects.

B - Private objects.

C - None of the above.

D - Both of the above.

Answer : A

plsql_questions_answers.htm
Advertisements