- 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 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 - Which of the following is not true about PL/SQL constants and literals?
A - A constant holds a value that once declared, does not change in the program.
B - The CONSTANT declaration cannot impose the NOT NULL constraint.
Answer : B
Q 3 - Which of the following is not true about PL/SQL loop structures?
B - The WHILE loop repeats a statement or group of statements while a given condition is true.
Answer : D
Q 4 - Which of the following is the correct syntax for creating a VARRAY named grades, which can hold 100 integers, in a PL/SQL block?
A - TYPE grades IS VARRAY(100) OF INTEGERS;
B - VARRAY grades IS VARRAY(100) OF INTEGER;
Answer : D
Q 5 - What would be the output of the following code?
DECLARE
a number;
b number;
c number;
FUNCTION fx(x IN number, y IN number)
RETURN number
IS
z number;
BEGIN
IF x > 2*y THEN
z:= x;
ELSE
z:= 2*y;
END IF;
RETURN z;
END;
BEGIN
a:= 23;
b:= 47;
c := fx(a, b);
dbms_output.put_line(c);
END;
Answer : C
Q 6 - Consider the exception declared as −
emp_exception1 EXCEPTION;
Which of the following statement will correctly call the exception in a PL/SQL block?
A - IF c_id <= 0 THEN ex_invalid_id;
B - IF c_id <= 0 THEN CALL ex_invalid_id;
Answer : C
Q 7 - Which of the following is not a benefit of a database trigger?
A - Enforcing referential integrity
B - Event logging and storing information on table access
Answer : C
Q 8 - Which of the following is not true about PL/SQL collections?
A - A collection is an ordered group of elements having the same data type.
B - A collection is an ordered group of elements having different data type.
C - Each element is identified by a unique subscript that represents its position in the collection.
D - Nested tables and Varrays are types of PL/SQL collections.
Answer : A
Q 9 - The collection method LIMIT
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 : C
Q 10 - Savepoints are set to
A - Help in splitting a long transaction into smaller units.
B - Help in rolling back to some checkpoint, within a long transaction.