- 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 the execution section of a PL/SQL block?
A - It is enclosed between the keywords BEGIN and END.
B - It is a mandatory section.
Answer : D
Q 2 - What value will be assigned to the variable declared as below −
counter binary_integer;
Answer : C
Q 3 - Which of the following is true about the following code snippet?
DECLARE a number(3) := 100; BEGIN IF (a = 50 ) THEN dbms_output.put_line('Value of a is 10' ); ELSIF ( a = 75 ) dbms_output.put_line('Value of a is 20' ); ELSE dbms_output.put_line('None of the values is matching'); END IF; dbms_output.put_line('Exact value of a is: '|| a ); END;
B - It will print 'None of the values is matching'.
None of the values is matching
Exact value of a is: 100
Answer : A
Explanation
it has the THEN keyword missing in the ELSIF statement
Q 4 - Consider the following code snippet: how many times the loop will run?
DECLARE a number(2) := 9; BEGIN WHILE a < 30 LOOP a := a + 3; END LOOP; END;
Answer : C
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 is not among the types of PL/SQL records?
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 a PL/SQL collection types?
A - Index-by tables or Associative array
Answer : D
Q 9 - Which of the following code is the correct syntax for creating an index-by table named salary that will store integer values along with names and the name field will be the key?
A - TYPE salary IS TABLE OF NUMBER INDEX BY VARCHAR2(20);
B - CREATE TABLE salary OF NUMBER INDEX BY VARCHAR2(20);
C - TYPE salary IS INDEXED TABLE OF NUMBER INDEX BY VARCHAR2(20);
Answer : A
Q 10 - Which of the following is true about member methods?
A - Member methods are used for manipulating the attributes of the object.
B - Declaration of a member method is provided while declaring the object type.
C - The object body defines the code for the member methods.
To Continue Learning Please Login
Login with Google