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

Answer : D

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

Q 3 - Which of the following is true about the following code snippet?

DECLARE
   a number(3) := 100;
BEGIN
   IF (a = 50 ) THEN
      dbms_output.put_line('Value of a is 10' );
   ELSIF ( a = 75 )
      dbms_output.put_line('Value of a is 20' );
   ELSE
       dbms_output.put_line('None of the values is matching');
   END IF;
   dbms_output.put_line('Exact value of a is: '|| a ); 
END;

A - It has syntax error.

B - It will print 'None of the values is matching'.

C - It will print

None of the values is matching

Exact value of a is: 100

D - None of the above.

Answer : A

Explanation

it has the THEN keyword missing in the ELSIF statement

Q 4 - Consider the following code snippet: how many times the loop will run?

DECLARE
   a number(2) := 9;
BEGIN
   WHILE a < 30 LOOP
      a := a + 3;
   END LOOP;
END;

A - 10

B - 8

C - 7

D - 9

Answer : C

Q 6 - Which of the following is not among the types of PL/SQL records?

A - Table-based

B - View-based

C - Cursor-based records

D - User-defined records

Answer : B

Answer : D

Q 9 - Which of the following code is the correct syntax for creating an index-by table named salary that will store integer values along with names and the name field will be the key?

A - TYPE salary IS TABLE OF NUMBER INDEX BY VARCHAR2(20);

B - CREATE TABLE salary OF NUMBER INDEX BY VARCHAR2(20);

C - TYPE salary IS INDEXED TABLE OF NUMBER INDEX BY VARCHAR2(20);

D - None of the above.

Answer : A

plsql_questions_answers.htm
Advertisements