PL/SQL Online Quiz


Advertisements


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 - Consider the following code −

DECLARE
   -- Global variables 
   num number := 95; 
BEGIN 
   dbms_output.put_line('num: ' || num1);
   DECLARE 
      -- Local variables
      num number := 195; 
     BEGIN 
      dbms_output.put_line('num: ' || num1);
     END; 
END;

What will happen when the code is executed?

A - It won’t execute, it has syntax error

B - It will print

     num: 95

     num: 195

C - It will print

     num: 95

     num: 95

D - It will print

     num: 195

     num: 195

Answer : B

Answer : D

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

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

Answer : B

Explanation

The Map method is a function implemented in such a way that its value depends upon the value of the attributes.


plsql_questions_answers.htm

Advertisements