PLSQL
PLSQL
This section presents you various set of Mock Tests related to PL/SQL. You can download these
sample mock tests at your local machine and solve offline at your convenience. Every mock test is
supplied with a mock test key to let you verify the final score and grade yourself.
Q 1 - Which of the following statement will create the specification for a package
named cust_sal
A-
B-
C-
D-
PACKAGE cust_sal AS
PROCEDURE find_sal(c_id customers.id%type);
END cust_sal;
A - package_name element_name;
B - element_name.package_name;
C - package_name.element_name;
C - Each element is identified by a unique subscript that represents its position in the collection.
B - Nested table
Q 6 - 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 - Nested tables are like one-dimensional arrays with arbitrary number of elements.
B - Unlike arrays a nested table doesn’t have declared number of elements. The size of a nested
table can increase dynamically.
C - Initially a nested array has consecutive subscripts or dense, but it can become sparse when
elements are deleted from it.
D - Elements of a nested table could also be %TYPE of any database table field.
Q 9 - Which of the following code is the correct syntax for creating a nested table
named salary that will store integer values?
A - Returns the last largest index numbers in a collection that uses integer subscripts.
A - Returns the last largest index numbers in a collection that uses integer subscripts.
A - Returns the last largest index numbers in a collection that uses integer subscripts.
C - A successfully executed SQL statement and a committed transaction are not same.
A - The SQL statements that constitute a transaction can collectively be either committed, i.e.,
made permanent to the database or rolled back undone from the database.
B - A DDL statement, like CREATE TABLE statement, is issued; because in that case a COMMIT is
automatically performed.
C - A DCL statement, such as a GRANT statement, is issued; because in that case a COMMIT is
automatically performed.
D - Answer a. and b.
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);
A - Hello!
B - He
Ho
C - Hello!
Hope you
D - Hello!
C - Objects are created using the CREATE [OR REPLACE] CLASS statement.
Q 20 - Which of the following code will create an object type named local_address with
two field house_no and street?
A-
B-
C-
D-
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.
B - The Map method is a function implemented in such a way that its value doesn’t depend upon
the value of the attributes.
C - The Order methods implement some internal logic for comparing two objects.
Q 24 - Which of the following is true about the inheritance for PL/SQL Objects?
Q 25 - The following code tries to create a base object named rectangle, which will be
inherited. What is wrong in the code?
B - The base object should not have any member attribute or functions.
ANSWER SHEET
Question Number Answer Key
1 B
2 C
3 A
4 D
5 D
6 A
7 D
8 A
9 A
10 C
11 A
12 B
13 D
14 D
15 D
16 D
17 D
18 A
19 C
20 B
21 D
22 D
23 B
24 D
25 C
Loading [MathJax]/jax/output/HTML-CSS/jax.js