You are on page 1of 10

1) PL/SQL is a completely portable, high- a. True b.

False
performance transaction processing language.
9) What is the maximum number of ELSE
a. True b. False clauses that can be included in an IF clause that
is not nested?
2) PL/SQL stored procedures move application
code from the server to the client. a. 1 b. 0 c. 15 d. Any number

a. True b. False 10) Which structure executes a sequence of


statements repeatedly as long as a condition holds
3) Which is a simple or compound symbol that true?
has a special meaning to PL/SQL?
a. Selection structure b. Iteration structure
a. Delimiters b. Identifiers c. Sequence structure d. None of the above
c. Literals d. Comments
11) “NO_DATA_FOUND” and
4) How many types of literals are available in “TOO_MANY_ROWS” are the two most
PL/SQL? common errors found when executing a SELECT
statement.
a. 6 b. 2 c. 5 d. 4
a. True b. False
5) Which operator tests set membership?
12) Varrays are a good choice when -
a. IN Operator b. BETWEEN Operator
c. LIKE Operator d. IS NULL Operator a. The number of elements is known in advance.
b. The elements are usually all accessed in sequence.
6) Which of the following has internal c. Both A & B
components that can be manipulated d. None of the above
individually, such as the elements of an array,
record, or table? 13) A collection method is a built-in function or
procedure that operates on collections and is
a. A Composite b. A LOB called using dot notation.
c. A Reference d. A Scalar
a. True b. False
7) Which subtypes are used to declare fixed-
point numbers with a maximum precision of 38 14) When building up a single SQL statement in
decimal digits? a string, do not include any semicolon at the end.

a. INTEGER,INT,SMALLINT a. Yes b. No
b. DOUBLE PRECISION,FLOAT
c. DEC,DECIMAL,NUMERIC 15) Dynamic SQL enables you to build SQL
d. None of the above statements dynamically at runtime.

8) A RECORD is a collection of data items, a. True b. False


which differ from each other in data type, but are
logically related. 16) Which of the following returns the current
value in a specified sequence.
a. CURRVAL b. NEXTVAL 25) The values of any IN OUT parameters are
c. Both A & B d. None of the above copied before the subprogram is executed.

17) Which operators combine the results of two a. Yes b. No


queries into one result?
1) PL/SQL provides a feature to handle the
a. Set operator b. Row Operator Exceptions which occur in a PL/SQL Block
c. Both A & B d. None of the above known as exception Handling.

18) A recursive subprogram is one that calls a. True b. False


itself.
2) Which Exception is also known as Oracle
a. True b. False named exception handler?

a. Predefined Exception
19) Which of the following provides a way for b. Internal Exception
your program to select multiple rows of data c. User defined Exception
from the database and then process each row d. None of the above
individually.
3) WRAP command is used to encrypt a
a. PL/SQL Cursors b. PL/SQL Trigger PL/SQL application.
c. PL/SQL Select d. PL/SQL Process
a. True b. False
20) Abbreviate SMTP?
4) Which Package lets you use database triggers
a. Single Mail Transaction Protocol
to alert an application when specific database
b. Simple Mail Transfer Protocol
values change?
c. Simple Mail Transaction Protocol
d. Simple Mail Transfer Package a. DBMS_OUTPUT b. DBMS_ALERT
c. DBMS_PIPE d. All mentioned above
21) Packages HTF and HTP allow your PL/SQL
programs to generate HTML tags. 5) PL/SQL packages are schema objects that
group logically related PL/SQL types, variables
a. True b. False and subprograms.
22) PL/SQL Exception message consists of - a. True b. False
a. Type of Exception b. An Error Code 6) Which statement lets you create standalone
c. A message d. All mentioned above functions that are stored in an Oracle database?
23) The keyword All is a shorthand way to refer a. SQL CREATE PROCEDURE
to all warning messages. b. SQL CREATE FUNCTION
c. Both A & B
a. Yes b. No d. None of the above
24) The subprogram is called through a
database link or as an external procedure. 7) Which parameter acts like a constant inside
the subprogram?
a. True b. False
a. IN b. OUT within an IF clause?
c. Both A & B d. None of the above
a. 1 b. 0 c. 15 d. Any number
8) Which of the following is used to define code 16) In PL/SQL, a warning or error condition is
that is executed / fired when certain actions or called an exception.
event occur?
a. True b. False
a. Replace b. Keyword c. Trigger d. Cursor

9) Which Operator Returns TRUE if a subquery 17) Which datatypes can be used with a
returns at least one row? RECORD Type?

a. EXISTS b. IN c. IS NULL d. LIKE a. NUMBER,VRCHAR2


b. %TYPE,OR %ROWTYPE
10) How many attributes does every explicit c. REF,CURSOR
cursor and cursor variable have? d. BOTH A & B
e. BOTH B & C
a. 3 b. 2 c. 4 d. 5
18) SIGNTYPE lets you restrict an integer
11) Th DBMS_SQL package should be used in variable to the values -1, 0, and 1, which is useful
which of the following situations? in programming tri-state logic.

a. 15. There is an unknown number of input or a. True b. False


output variables, such as the number of column
values returned by a query, that are used in a
dynamic SQL statement. 19) Is it possible to define a NOT NULL field in
b. The dynamic code is too large to fit inside a a record?
32K bytes VARCHAR2 variable.
c. Both A & B a. Yes b. No
d. None of the above
20) PL/SQL keywords are not case-sensitive.
12) A function called from SQL statements must
obey certain rules meant to control side effects. a. True b. False

a. True b. False 21) PL/SQL stands for -

13) Collection is an ordered group of elements, a. Programming Language/SQL


all of the same type. b. Procedural Language/SQL
c. Portable Language/SQL
a. True b. False d. None of the above

14) Arrays in other languages become varrays in 22) Pragmas are processed at ___________ .
PL/SQL.
a. Run time b. Compile time
a. True b. False c. Both A & B d. None of the above

15) How many nested IF clauses can be included 23) Which statement chooses from a sequence of
conditions, and executes a corresponding
statement? 6) LOB locators are values, which specify the
location of the large object.
a. CASE Statement b. CLOSE Statement
c. COMMIT Statement d. None of the above a. True b. False

24) Constructors are functions that return a new 7) Which statements execute a sequence of
object as its value. statements multiple times?

a. True b. False a. EXIT b. LOOP


c. Both A & B d. None of the above
25) An object type can represent any real-world
entity. 8) Oracle predefined errors are not associated
with specific error codes.
a. Yes b. No
a. True b. False
1) Which of the following is used for reading
and writing operating-system files? 9) Which of the following cannot be used with
associative arrays?
a. UTL_FILE b. UTL_HTTP
c. UTL_SMTP d. None of the above a. EXTEND b. TRIM
c. Both A & B d. None of the above
2) Which error occurs while the program is
running and cannot be detected by the PL/SQL 10) In the Restrictions on Record Inserts and
compiler? Updates, which of the following are not
supported?
a. Syntax error b. Runtime error
c. Both A & B d. None of the above a. Nested record types
b. Functions that return a record
3) Which keyword is used instead of the c. Record inserts and updates using the
assignment operator to initialize variables? EXECUTE IMMEDIATE statement
d. All mentioned above
a. NOT NULL b. DEFAULT
c. %TYPE d. %ROWTYPE 11) By using which clause, the mode is OUT, so
you cannot specify a parameter mode for output
4) PL/SQL programs are written as lines of text bind arguments?
using a specific set of characters.
a. USING Clause
a. Upper- and lower-case letters A .. Z and a .. z b. RETURNING INTO Clause
b. Numerals 0 .. 9 c. Both A & B
c. Symbols ( ) + - * / < > = ! ~ ^ ; : . ' @ % , " # $ d. None of the above
&_|{}?[]
d. Tabs, spaces, and carriage returns 12) You can use the BULK COLLECT INTO
e. All mentioned above clause with the EXECUTE IMMEDIATE
statement to store values from each column of a
5) How many bytes does each character in the query's result set in a separate collection.
AL16UTF16 encoding take up?
a. Yes b. No
a. 1 b. 2 c. 3 d. 6
13) Which of the following returns all distinct a. Header Only b. Declarative
rows selected by either query? c. Executable and Header
d. Executable and exception handling
a. INTERSECT b. MINUS
c. UNION d. UNION ALL 22) Which of the following returns the current
error message text?
14) Which statements are used to control a
cursor variable? a. SQLERRM b. SQLCODE
c. Both A & B d. None of the above
a. OPEN-FOR b. FETCH
c. CLOSE d. All mentioned above 23) Which datatypes are PL/SQL-only datatypes
that are more efficient than the SQL datatypes
15) What is the maximum number of triggers NUMBER or INTEGER for integer arithmetic?
that can apply to a single table?
a. PLS_INTEGER
a. 14 b. 10 c. 12 d. 16 b. BINARY_INTEGER
c. Both A & B d. None of the above
16) The variables or expressions passed from the
calling subprogram are - 24) In which binding operation a database value
is assigned to a PL/SQL variable or a host
a. Actual Parameters b. Formal Parameters variable by the RETURNING clause of an
c. Both A & B d. None of the above INSERT, UPDATE, or DELETE statement.
17) Subprograms are named PL/SQL blocks a. out-bind b. in-bind
that can be called with a set of parameters. c. define d. None of the above
a. True b. False 25) Which datatypes make it practical to write
PL/SQL programs to do number-crunching, for
18) Which of the following is not a schema scientific applications involving floating-point
object? calculations.
a. Packages b. Indexes a. BINARY_FLOAT b. BINARY_DOUBLE
c. Public Synonyms d. Triggers c. Both A & B d. None of the above
19) Which package lets PL/SQL programs read 1) The AUTONOMOUS_TRANSACTION
and write operating system (OS) text files? pragma changes the way a subprogram works
within a transaction.
a. UTL_HTTP b. UTL_FILE
c. UTL_SMTP d. None of the above a. True b. False
20) You can pass parameters to procedures or 2) __________ is a numeric expression that must
functions in a package. return a value of type
PLS_INTEGER,BINARY_INTEGER, or a value
a. True b. False
implicitly convertible to that datatype.

a. index b. indicator_name
21) When creating a function, in which section
c. field_name d. host_variable_name
will you typically find a return key word?
3) Which statements execute a sequence of d. None of the above
statements multiple times?
10) Which collection method Returns the index
a. LOOP statement b. NULL statement number that precedes index n in a collection?
c. MERGE statement d. None of the above
a. PRIOR(n) b. LAST c. LIMIT d. COUNT
4) Which methods implement some internal
logic for comparing two objects? For example, a 11) Subprograms let you extend the PL/SQL
rectangle is bigger than another rectangle if both language. Which subprogram acts like new
its sides are bigger. expressions and operators?

a. Order method b. Map method a. Procedures b. Functions


c. Both A & B d. None of the above c. Both A & B d. None of the above

5) The comparison methods are used for 12) In which parameter mode Formal
comparing objects. How many ways are available parameter acts like an initialized variable?
for comparing objects?
a. IN b. OUT
a. 4 b. 1 c. 2 d. 5 c. IN OUT d. None of the above

13) Which attribute returns NULL?


6) When implementing methods using PL/SQL,
you cannot call a base or supertype object a. %FOUND b. %ISOPEN
method with the super keyword or an equivalent c. %NOTFOUND d. %ROWCOUNT
method in a derived object.
14) With PL/SQL, it is very simple to issue a
a. True b. False query, retrieve each row of the result into a
%ROWTYPE record, and process each row in a
7) For a user-defined exception, SQLCODE loop.
returns 1, and SQLERRM returns ___________.
a. True b. False
a. “User-defined Exception” b. 1
c. 0 d. None of the above 15) You can use the BULK COLLECT INTO
clause with the FETCH statement to store values
8) Which of the following is handled with the from each column of a cursor in a separate
help of exception-handling section in an PL/SQL collection.
block. For eg, SELECT INTO statement, which
does not return any rows. a. True b. False
a. A runtime error b. A syntax error 16) To process most dynamic SQL statements,
c. Both A & B d. None of the above you use the EXECUTE IMMEDIATE statement.
To process a multi-row query (SELECT
9) A package will have which of these statement), which of these statements would you
mandatory parts? use?
a. Package specification a. OPEN-FOR b. FETCH
b. Package body or definition c. CLOSE d. All mentioned above
c. Both A & B
17) You can use the RETURNING BULK separate routines called exception handlers.
COLLECT INTO clause with the EXECUTE
IMMEDIATE statement to store the results of a. Yes b. No
which statements in a set of collections?
24) What are the different datatypes that can be
a. INSERT b. UPDATE defined in a PL/SQL block?
c. DELETE d. All mentioned above
a. Scalar b. Composite c. Reference
d. LOB e. All mentioned above
18) Which of the following is a group of related
data items stored in fields, each with its own 25) The BINARY_INTEGER and
name and datatype? PLS_INTEGER datatypes are not identical.
a. A Record b. A Collection a. True b. False
c. Both A & B d. None of the above
26) Which of the following results are true,
19) Nested tables are a good choice when when a ROLLBACK statement is issued to the
database, the transaction has ended?
a. The index values are not consecutive.
b. There is no set number of index values. a. All work done by the transaction is undone, as
However, a maximum limit is imposed. if it hadn't been issued.
c. You need to delete or update some elements, b. Any locks acquired by the transaction are
but not all the elements at once. released.
d. You would usually create a separate lookup c. Both A & B
table, with multiple entries for each row of the d. None of the above
main table, and access it through join queries.
e. All mentioned above 27) PL/SQL Expressions are constructed using.

a. Operands b. Operators
20) Associative arrays also known as index-by
c. Both A & B d. None of the above
tables.
28) Which of the following are used for
a. True b. False
displaying output on a web page?
21) Which type of cursor is automatically
a. HTF b. HTP
declared by Oracle every time an SQL statement
c. Both A & B d. None of the above
is executed?
29) Like all identifiers, the names of constants,
a. An Implicit b. An Explicit
variables, and parameters are case sensitive.
c. Both A & B d. None of the above
a. True b. False
22) An Explicit cursor is defined by the program
for any query that returns more than one row of 30) Cursor attributes are not affected by
data. autonomous transactions.
a. True b. False a. True b. False
23) To handle raised exceptions, you write 1) Which of the following is used to declare a
record? a. Error reporting,Character, Datatype
conversion
a. %ROWTYPE b. %TYPE b. Number,Date,Object reference
c. Both A & B d. None of the above c. Miscellaneous
d. All mentioned above
2) Which of the following has a return type in its
specification and must return a value specified in 8) A searched CASE expression lets you test
that type? different conditions instead of comparing a single
expression to various values.
a. Function b. Procedure
c. Package d. None of the above a. Yes b. No

3) PL/SQL is completely portable, high- 9) PL/SQL Server Pages (PSPs) enable you to
performance transaction processing language develop Web pages with dynamic content.
that offers which of the following advantages -
a. True b. False
a. Tight Integration with SQL
b. Better Performance 10) Using DBMS_DB_VERSION Package
c. Higher Productivity,Full Portability,Tight Constants which represents the condition that the
Security database version is less than or equal to 10; it is
d. All mentioned above TRUE.

4) From the following PL/SQL Delimiters which a. VER_LE_10 b. VER_LE_10_2


symbol is exponentiation operator. c. Both A & B d. None of the above

a. <> b. ~= c. ** d. – 11) Which internal exception is raised when a


program references a nested table or varray
5) In CASE Expressions, which expression element using an index number larger than the
selects a result from one or more alternatives, number of elements in the collection.
and returns the result?
a. NO_DATA_FOUND
a. Simple CASE Expression b. COLLECTION_IS_NULL
b. Searched CASE Expression c. SUBSCRIPT_OUTSIDE_LIMIT
c. Both A & B d. SUBSCRIPT_BEYOND_COUNT
d. None of the above
12) A package cursor is a cursor which you
6) Which of the following is an explicit numeric, declare in the package specification without an
character, string, or BOOLEAN value not SQL statement.
represented by an identifier?
a. Yes b. No
a. Delimiters b. Literals
c. Comments d. None of the above 13) In which of the following, do you specify the
same parameters in the same order as they are
7) PL/SQL provides many powerful functions to declared in the procedure?
help you manipulate data. These built-in
functions fall into which of these following a. Positional notation b. Named notation
categories? c. Mixed notation d. All mentioned above
14) In which mode parameter lets you pass d. SUBSCRIPT_OUTSIDE_LIMIT
values to the subprogram being called? It cannot
be assigned a value. 20) Which of the following executes the query
and identifies the result set, consisting of all rows
a. Using the IN mode b. Using the OUT mode that meet the query search criteria.
c. Both A & B d. None of the above
a. Fetching with a Cursor
15) To call a subprogram directly, users must b. Opening a cursor
have the EXECUTE privilege on that c. Fetching bulk data with a cursor
subprogram. By granting the privilege, you allow d. None of the above
a user to -
21) Which statement associates a cursor
a. Call the subprogram directly variable with a multi-row query, executes the
b. Compile functions and procedures that call the query, and identifies the result set?
subprogram
c. Both A & B a. OPEN-FOR b. FETCH
d. None of the above c. CLOSE d. All mentioned above

16) Which is a database object that groups 22) LOB parameters are not permitted in a
logically related PL/SQL types, objects and server-to-server RPC.
subprograms?
a. Yes b. No
a. Package b. Module c. Body d. Name
23) The CLOSE statement enables a cursor
17) Only EXISTS can be applied to variable and makes the associated result set
automatically null collections. If you apply undefined.
another method to such collections, PL/SQL
raises COLLECTION_IS_NULL. a. True b. False

a. Yes b. No 24) You use cursor variables to pass query


result sets between PL/SQL stored subprograms
18) Which collection exception is raised when a and various clients.
subscript designates an element that was deleted,
or a nonexistent element of an associative array? a. Yes b. No

a. NO_DATA_FOUND 25) A subquery is a query (usually enclosed by


b. COLLECTION_IS_NULL parentheses) that appears within another SQL
c. SUBSCRIPT_BEYOND_COUNT data manipulation statement.
d. SUBSCRIPT_OUTSIDE_LIMIT
a. True b. False
19) Which collection exception is raised when a
subscript exceeds the number of elements in a 26) A nested cursor is implicitly opened when
collection? the containing row is fetched from the parent
cursor. The nested cursor is closed in which of
a. VALUE_ERROR the following case(s)?
b. COLLECTION_IS_NULL
c. SUBSCRIPT_BEYOND_COUNT a. The nested cursor is explicitly closed by the
user
b. The parent cursor is re-executed %ROWTYPE datatype?
c. The parent cursor is closed
d. The parent cursor is canceled a. It is useful to retrieve an entire row from a
e. All mentioned above table. If you do not use the %ROWTYPE
datatype, then you have to declare variables for
27) Which datatype is used to store large blocks each column separately.
of character data in the database, in-line or out- b. It can be used even if data type of the table
of-line? Both fixed-width and variable-width columns is not known.
character sets are supported. c. It ensures that data type of the variable
changes dynamically if the underlying table is
a. BLOB b. CLOB c. BFILE d. NCLOB altered.
d. All mentioned above
28) Is it possible to define a CONSTANT value e. Both A & B
in a record?
35) The LOB objects can be stored in-line or
a. Yes b. No out-of-line. The in-line storage means that objects
are stored.
29) Which data type supports only sequential
access of objects? a. Along with the row b. Outside the row
c. Both A & B d. None of the above
a. LONG b. LOB
c. Both A & B d. None of the above

30) Can BOOLEAN datatype be used in


functions that are called from SQL statements?

a. Yes b. No

31) PL/SQL is a transaction processing


procedural language that has which of the
following advantages?

a. Integration with database


b. Better Performance c. Higher Productivity
d. Portability e. All mentioned above

32) Explicit datatypes, %TYPE and


%ROWTYPE, without size specification can be
used for parameters in a procedure.

a. True b. False

33) Oracle-supplied package called DBMS_LOB


is used to manipulate the LOB objects.

a. True b. False

34) What is the advantage of using the

You might also like