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 4 - Consider a variable named greetings declared as −

greetings varchar2(11) := 'Hello World';

What will be the output of the code snippet

dbms_output.put_line ( SUBSTR (greetings, 7, 5));

A - World

B - Hello

C - orld

D - None of the above.

Answer : A

Q 5 - What would be the output of the following code?

DECLARE
   num number;
   fn number;

FUNCTION fx(x number)
RETURN number 
IS
   f number;
BEGIN
   IF x=0 THEN
      f := 1;
   ELSE
      f := x * fx(x-1);
   END IF;
RETURN f;
END;

BEGIN
   num:= 5;
   fn := fx(num);
   dbms_output.put_line(fn);
END;

A - 1

B - 5

C - 10

D - 125

Answer : D

Answer : D

plsql_questions_answers.htm
Advertisements