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 not true about the PL/SQL language?
A - PL/SQL's general syntax is based on that of ADA and Pascal programming language.
B - Apart from Oracle, PL/SQL is available in TimesTen in-memory database and IBM DB2.
Answer : D
Q 2 - Which of the following is true about scalar data types in PL/SQL?
A - They hold single values with no internal components.
B - Examples of scalar data types are NUMBER, DATE, or BOOLEAN.
Answer : D
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 not true about the PL/SQL data structure VARRAY?
A - In oracle environment, the starting index for VARRAYs is always 1.
Answer : D
Q 5 - What will be printed by the following PL/SQL block?
DECLARE a number; PROCEDURE squareNum(x IN OUT number) IS BEGIN x := x * x; END; BEGIN a:= 5; squareNum(a); dbms_output.put_line(a); END;
Answer : C
Q 6 - Which of the following is not among the types of PL/SQL records?
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 is true about PL/SQL package body?
Answer : A
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.
Answer : C
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.