wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PL/SQL Programming

Total questions: 15

Worksheet time: 10mins

Name
Class
Date
1.

which valid identifier?

a)

today

b)

last_name

c)

today's date

d)

Number_of_days_in_February_this_year

e)

Isleap$year

2.

Which valid variable declaration and initialization?

a)

number_of_copies PLS_INTEGER;

b)

PRINTER_NAME constant VARCHAR2(10);

c)

deliver_to VARCHAR2(10):=Johnson;

d)

by_when DATE:= CURRENT_DATE+1;

3.

The %TYPE attribute:

a)

Is used to declare a variable according to a database column definition

b)

Is used to declare a variable according to a collection of columns in a database table or view

c)

Is used to declare a variable according to the definition of another declared variable

d)

Is prefixed with the database table and column name or the name of the declared variable

4.

You can use most SQL single-row functions such as number, character, conversion, and date single-row functions in PL/SQL expressions.

a)

True

b)

False

5.

When using the SELECT statement in PL/SQL, the INTO clause is required and queries can return one or more row.

a)

True

b)

False

6.

There are three types of loops: basic, FOR, and WHILE.

a)

True

b)

False

7.

Identify situations in which you can use the %ROWTYPE attribute

a)

When you are not sure about the structure of the underlying database table

b)

When you want to retrieve an entire row from a table

c)

When you want to declare a variable according to another previously declared variable or database column

8.

You can trap any error by including a corresponding handler within the exception-handling section of the PL/SQL block

a)

True

b)

False

9.

Subprograms:

a)

Are named PL/SQL blocks and can be invoked by other applications

b)

Are compiled only once

c)

Are stored in the database

d)

Do not have to return values if they are functions

e)

Can take parameters

10.

Formal parameters are literal values, variables, and

expressions used in the parameter list of the calling

subprogram

a)

True

b)

False

11.

A PL/SQL stored function:

a)

Does not contain a RETURN clause in the header

b)

Can be invoked as part of an expression

c)

Must contain a RETURN clause in the header

d)

Must return a single value

e)

Must contain at least one RETURN statement

12.

The package specification is the interface to your applications. It declares the public types, variables, constants, exceptions, cursors, and subprograms available for use.

a)

True

b)

False

13.

Overloading subprograms in PL/SQL:

a)

Requires that the subprogram’s formal parameters differ in

number, order, or data type family

b)

Enables you to build flexible ways for invoking

subprograms with different data

c)

Provides a way to extend functionality without loss of

existing code; that is, adding new parameters to existing

subprograms

d)

Enables you to create two or more subprograms with the

same name

14.

The Oracle-supplied UTL_FILE package is used to access

text files in the operating system of the database server.

The database provides functionality through directory objects to allow access to specific operating system directories.

a)

False

b)

True

15.

A triggering event can be one or more of the following:

a)

A CREATE, ALTER, or DROP statement on any schema

object

b)

A specific error message or any error message

c)

A database startup or instance shutdown

d)

An INSERT, UPDATE, or DELETE statement on a specific

table (or view, in some cases)

e)

A user logon or logoff