- 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
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 the output of the following code?
DECLARE x number := 4; BEGIN LOOP dbms_output.put_line(x); x := x + 1; exit WHEN x > 5; END LOOP; dbms_output.put_line(x); END;
Answer : A
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 not true about the PL/SQL functions?
A - A PL/SQL function is same as a procedure except that it returns a value.
B - The function body must contain a RETURN statement.
C - The RETURN clause does not specify the data type of the return value.
D - The AS keyword is used instead of the IS keyword for creating a standalone function.
Answer : C
Q 6 - Which of the following code will successfully declare an exception named emp_exception1 in a PL/SQL block?
Answer : B
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 WHEN clause?
Answer : A
Q 8 - Which of the following syntax will be used to access a package element?
A - package_name element_name;
B - element_name.package_name;
Answer : C
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.