- 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 - 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 - 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 - Consider a variable named greetings declared as −
greetings varchar2(11) := 'Hello World';
What will be the output of the code snippet
dbms_output.put_line ( SUBSTR (greetings, 7, 5));
Answer : A
Q 5 - What would be the output of the following code?
DECLARE num number; fn number; FUNCTION fx(x number) RETURN number IS f number; BEGIN IF x=0 THEN f := 1; ELSE f := x * fx(x-1); END IF; RETURN f; END; BEGIN num:= 5; fn := fx(num); dbms_output.put_line(fn); END;
Answer : D
Q 6 - The pre-defined exception CASE_NOT_FOUND is raised when
B - PL/SQL has an internal problem.
C - A cursor fetches value in a variable having incompatible data type.
Answer : A
Q 7 - The pre-defined exception TOO_MANY_ROWS is raised when
A - PL/SQL ran out of memory or memory was corrupted.
B - A cursor fetches value in a variable having incompatible data type.
Answer : C
Q 8 - Which of the following is a PL/SQL collection types?
A - Index-by tables or Associative array
Answer : D
Q 9 - A transaction starts when
A - The first SQL statement is performed after connecting to the database.
B - At each new SQL statement issued after a transaction is completed.
Answer : D
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.