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

Answer : B

Explanation

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

Answer : A

Explanation

A cursor is a memory area, known as context area, for processing an SQL statement, which contains all information needed for processing the statement.

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 WHEN clause?

A - This provides a condition for rows for which the trigger would fire and this clause is valid only for row level triggers.

B - This provides a condition for rows for which the trigger would fire and this clause is valid only for table level triggers.

C - This provides a condition for rows for which the trigger would fire and this clause is valid only for view based triggers.

D - All of the above.

Answer : A

Q 10 - The following code tries to create a base object named rectangle, which will be inherited. What is wrong in the code?

CREATE OR REPLACE TYPE rectangle AS OBJECT
(length number,
 width number,
 member function enlarge( inc number) return rectangle,
 NOT FINAL member procedure display) 

A - The declaration should read as CREATE OR REPLACE OBJECT rectangle AS …

B - The base object should not have any member attribute or functions.

C - The base object rectangle should be declared as NOT FINAL.

D - None of the above

Answer : C

Explanation

The corrected code is −

CREATE OR REPLACE TYPE rectangle AS OBJECT
(length number,
 width number,
 member function enlarge( inc number) return rectangle,
 NOT FINAL member procedure display) NOT FINAL
plsql_questions_answers.htm
Advertisements