- 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.
Answer : A
Q 2 - Consider the following code −
DECLARE -- Global variables num number := 95; BEGIN dbms_output.put_line('num: ' || num1); DECLARE -- Local variables num number := 195; BEGIN dbms_output.put_line('num: ' || num1); END; END;
What will happen when the code is executed?
A - It won’t execute, it has syntax error
B - It will print num: 95 num: 195
Answer : B
Q 3 - Which of the following is not true about labelling PL/SQL loops?
A - PL/SQL loops can be labelled.
B - The label should be enclosed by angle brackets (< and >).
C - The label name appears at the beginning of the LOOP statement.
D - The label name can also appear at the end of the LOOP statement or with an EXIT statement.
Answer : B
Explanation
The label should be enclosed by double angle brackets (<< and >>)
Q 4 - Consider the following code snippet: how many times the loop will run?
DECLARE a number(2); BEGIN FOR a in 10 .. 20 LOOP END LOOP; END;
Answer : A
Q 5 - Which of the following is not true about PL/SQL cursors?
A - A cursor is a view on a table.
B - A cursor holds the rows (one or more) returned by a SQL statement.
C - The set of rows the cursor holds is referred to as the active set.
Answer : A
Explanation
A cursor is a memory area, known as context area, for processing an SQL statement, which contains all information needed for processing the statement.
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 - 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;
The {INSERT [OR] | UPDATE [OR] | DELETE} clause specifies a
Answer : B
Q 8 - Which of the following is not true about PL/SQL package specifications?
A - The specification is the interface to the package.
C - It contains all information about the content of the package and the code for the subprograms.
Answer : C
Q 9 - Which of the following is true about PL/SQL nested tables?
A - Nested tables are like one-dimensional arrays with arbitrary number of elements.
Answer : D
Q 10 - What will be the output of the following code?
DECLARE lines dbms_output.chararr; num_lines number; BEGIN dbms_output.enable; dbms_output.put_line('Hello!'); dbms_output.put_line('Hope you are doing well!'); num_lines := 2; dbms_output.get_lines(lines, num_lines); FOR i IN 1..num_lines LOOP dbms_output.put_line(lines(i)); END LOOP; END;
Hope you are doing well!
Ho
Hope you
To Continue Learning Please Login
Login with Google