- 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 - What would be printed when the following code is executed?
DECLARE x NUMBER; BEGIN x := 5; x := 10; dbms_output.put_line(-x); dbms_output.put_line(+x); x := -10; dbms_output.put_line(-x); dbms_output.put_line(+x); END;
Answer : A
Q 3 - What will be the output of the following code snippet?
DECLARE a number(3) := 100; b number(3) := 200; BEGIN IF( a = 100 ) THEN IF( b <> 200 ) THEN dbms_output.put_line(b); END IF; END IF; dbms_output.put_line(a); END;
Answer : D
Q 4 - Which of the following is true about the PL/SQL data structure VARRAY?
A - It also has a maximum size that cannot be changed.
B - A VARRAY type is created with the CREATE VARRAY statement, at the schema level.
C - Maximum size of a VARRAY can be changed using the ALTER TYPE statement.
D - Maximum size of a VARRAY can be changed using the ALTER VARRAY statement.
Answer : C
Q 5 - Which of the following is a way of passing parameters to PL/SQL subprograms?
Answer : D
Q 6 - The following code tries to fetch some information from all the rows in a table named customers for use in a PL/SQL block. What is wrong in the following code?
DECLARE c_id customers.id%type; c_name customers.name%type; c_addr customers.address%type; CURSOR c_customers is SELECT id, name, address FROM customers; BEGIN LOOP FETCH c_customers into c_id, c_name, c_addr; EXIT WHEN c_customers%notfound; dbms_output.put_line(c_id || ' ' || c_name || ' ' || c_addr); END LOOP; CLOSE c_customers; END;
Answer : B
Q 7 - Triggers are written to be executed in response to any of the following events −
A - A database manipulation (DML) statement (DELETE, INSERT, or UPDATE).
B - A database definition (DDL) statement (CREATE, ALTER, or DROP).
C - A database operation (SERVERERROR, LOGON, LOGOFF, STARTUP, or SHUTDOWN).
Answer : D
Q 8 - Which of the following is true about PL/SQL index-by tables?
A - It is a set of key-value pairs.
B - Each key is unique and is used to locate the corresponding value.
Answer : D
Q 9 - Which of the following is true about database transactions?
Answer : D
Q 10 - Which of the following is true about the inheritance for PL/SQL Objects?
A - PL/SQL allows creating object from existing base objects.
B - To implement inheritance, the base objects should be declared as NOT FINAL.
C - The NOT INSTANTIABLE clause allows you to declare an abstract object.
To Continue Learning Please Login
Login with Google