- 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 true about the PL/SQL language?
A - PL/SQL provides access to predefined SQL packages.
B - PL/SQL provides support for Object-Oriented Programming.
C - PL/SQL provides support for Developing Web Applications and Server Pages.
Answer : D
Q 2 - Which of the following is true about character data types and subtypes in PL/SQL?
A - LONG is a variable-length character string with maximum size of 32,760 bytes.
B - ROWID is a physical column identifier, the address of a column in an ordinary table.
C - CHAR is a variable-length character string with maximum size of 32,767 bytes.
D - NCHAR is a variable-length national character string with maximum size of 32,767 bytes.
Answer : A
Q 3 - What is the output of the following code?
DECLARE
grade char(1) := 'B';
BEGIN
case
when grade = 'A' then dbms_output.put_line('Excellent');
when grade = 'B' then dbms_output.put_line('Very good');
when grade = 'C' then dbms_output.put_line('Well done');
when grade = 'D' then dbms_output.put_line('You passed');
when grade = 'F' then dbms_output.put_line('Better try again');
else dbms_output.put_line('No such grade');
end case;
END;
Answer : C
Q 4 - Consider the following code snippet: what will be the output?
DECLARE a number(2) ; BEGIN FOR a IN REVERSE 10 .. 20 LOOP END LOOP; dbms_output.put_line(a); END;
Answer : B
Q 5 - Observe the following code and fill in the blanks −
DECLARE
total_rows number(2);
BEGIN
UPDATE employees
SET salary = salary + 500;
IF ____________ THEN
dbms_output.put_line('no employees selected');
ELSIF ___________ THEN
total_rows := _____________;
dbms_output.put_line( total_rows || ' employees selected ');
END IF;
END;
A - %notfound, %found, %rowcount.
B - sql%notfound, sql%found, sql%rowcount.
Answer : B
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 true for querying a table in the same trigger?
Answer : A
Q 8 - Which of the following is not true about PL/SQL packages?
B - A package has two parts: Package specification and Package body or definition.
Answer : D
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.