- 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 true about comments in PL/SQL?
A - Comments are explanatory statements.
B - PL/SQL supports both single-line and multi-line comments.
Answer : D
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 - What is wrong in the following code snippet?
DECLARE x number := 1; BEGIN LOOP dbms_output.put_line(x); x := x + 1; IF x > 10 THEN exit; END IF; dbms_output.put_line('After Exit x is: ' || x); END;
B - The IF statement is not required.
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 - Which of the following is a way of passing parameters to PL/SQL subprograms?
Answer : D
Q 6 - Which of the following code will successfully declare an exception named emp_exception1 in a PL/SQL block?
Answer : B
Q 7 - Which of the following is true for querying a table in the same trigger?
Answer : A
Q 8 - All objects placed in a package specification are called
Answer : A
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 code will create an object type named local_address with two field house_no and street?
A -
CREATE OR REPLACE OBJECT local_address
(house_no varchar2(10),
street varchar2(30),
);
B -
CREATE OR REPLACE TYPE local_address AS OBJECT
(house_no varchar2(10),
street varchar2(30),
);
C -
CREATE OR REPLACE OBJECT local_address AS
(house_no varchar2(10),
street varchar2(30),
);
D -
CREATE OR REPLACE CLASS local_address
(house_no varchar2(10),
street varchar2(30),
);