- PL/SQL Tutorial
- PL/SQL - Home
- PL/SQL - Overview
- PL/SQL - Environment
- PL/SQL - Basic Syntax
- PL/SQL - Data Types
- PL/SQL - Variables
- PL/SQL - Constants and Literals
- PL/SQL - Operators
- PL/SQL - Conditions
- PL/SQL - Loops
- PL/SQL - Strings
- PL/SQL - Arrays
- PL/SQL - Procedures
- PL/SQL - Functions
- PL/SQL - Cursors
- PL/SQL - Records
- PL/SQL - Exceptions
- PL/SQL - Triggers
- PL/SQL - Packages
- PL/SQL - Collections
- PL/SQL - Transactions
- PL/SQL - Date & Time
- PL/SQL - DBMS Output
- PL/SQL - Object Oriented
- PL/SQL Useful Resources
- PL/SQL - Questions and Answers
- PL/SQL - Quick Guide
- PL/SQL - Useful Resources
- PL/SQL - Discussion
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.
Q 1 - Which of the following is not true about the declaration section of a PL/SQL block?
A - This section starts with the DECLARE keyword.
B - It is a mandatory section.
C - It defines all variables, cursors, subprograms, and other elements to be used in the program.
Answer : B
Q 2 - What value will be assigned to the variable declared as below −
counter binary_integer;
Answer : C
Q 3 - Which of the following is not true about labelling PL/SQL loops?
A - PL/SQL loops can be labelled.
B - The label should be enclosed by angle brackets (< and >).
C - The label name appears at the beginning of the LOOP statement.
D - The label name can also appear at the end of the LOOP statement or with an EXIT statement.
Answer : B
Explanation
The label should be enclosed by double angle brackets (<< and >>)
Q 4 - Which of the following is not true about the PL/SQL data structure VARRAY?
A - It is a fixed-size sequential collection of elements.
B - The elements can of various data types.
C - It is used to store an ordered collection of data.
D - Each element in a VARRAY has an index associated with it.
Answer : B
Q 5 - What will be printed by the following PL/SQL block?
DECLARE a number; PROCEDURE squareNum(x IN OUT number) IS BEGIN x := x * x; END; BEGIN a:= 5; squareNum(a); dbms_output.put_line(a); END;
Answer : C
Q 6 - Which of the following is not true about PL/SQL records?
A - A PL/SQL record is a data structure that can hold data items of different kinds.
B - Records consist of different fields, similar to a row of a database table.
C - You can create table-based and cursor-based records by using the %ROWTYPE attribute.
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?
B - OLD and NEW references are not available for table level triggers.
Answer : D
Q 8 - Which of the following is true about PL/SQL package body?
Answer : A
Q 9 - The collection method LAST
A - Returns the last (largest) index numbers in a collection that uses integer subscripts.
B - Returns the number of elements that a collection currently contains.
Answer : A
Q 10 - Which of the following is not true about object oriented PL/SQL?
A - It helps in designing object-oriented database in Oracle.
B - An object type allows you to crate composite types.
C - Objects are created using the CREATE [OR REPLACE] CLASS statement.
To Continue Learning Please Login
Login with Google