You are on page 1of 22

Final Exam Theory Test(Quiz-Part 1 only)

Question 1 (1 point)

Saved
Listen

The term "formal parameters" refers to the arguments that are used
when calling or invoking the program unit.
Question 1 options:
False

True

Question 2 (1 point)

Saved
Listen

Only one triggering event can be addressed in a single trigger.


Question 2 options:
False

True

Question 3 (1 point)

Saved
Listen

A database trigger is tied to a database table or view and is implicitly


fired by the database system when that table or view is affected with
the associated DML action.
Question 3 options:
True

False

Question 4 (1 point)

Saved
Listen

One prominent limitation in the use of triggers is that they cannot issue
transaction control statements of COMMIT, ROLLBACK, and
SAVEPOINT.
Question 4 options:
True

False

Question 5 (1 point)

Saved
Listen

Packaged variable values are persistent throughout a user session and


each user of the package has his or her own copy of the packaged
variable.
Question 5 options:
True

False

Question 6 (1 point)

Saved
Listen
Functions are used in CHECK constraints or as a default values of table
columns.
Question 6 options:
False

True

Question 7 (1 point)

Saved
Listen

You cannot include data type information when declaring a formal


parameter.
Question 7 options:
False

True

Question 8 (1 point)

Saved
Listen

A REEF CURSOR data type declared in a package specification may be


referenced by multiple program units.
Question 8 options:
True

False

Question 9 (1 point)

Saved
Listen

System triggers are typically used to allow the modification of data


through a view on a view that is nonmodifiable.
Question 9 options:
False

True

Question 10 (1 point)

Saved
Listen

You can include multiple RETURN statements in the body of a function.


Question 10 options:
True

False

NoSQL - MongoDB
Question 11 (2 points)

Saved
Listen

What does the following query do when performed on the post


collection
db.posts.update({$set: {_id:1}}) ?
Question 11 options:

Replaces _id with 1

Inserts a new object

Generates an error
updates the title
Question 12 (2 points)

Saved
Listen

Which of the following commands inside the aggregate pipeline is used


to filter documents?
Question 12 options:

$group

$aggregate

$match

$sum
Question 13 (2 points)

Saved
Listen

Which of the following is the correct explanation of the MongoDB


processes?
Question 13 options:

mongo.exe is the shell process and mongod.exe is the database process

mongod.exe is the shell process and mongo.exe is the client process

mongodump.exe can be used to import a backup database

mongos.exe is the MongoDB service to run the database


Question 14 (2 points)

Saved
Listen

Which of the following SQL terminology is same as $match?


Question 14 options:

where

group by

having

having and where


Question 15 (2 points)

Saved
Listen

Which option can be used with the update command to create a new
document?
Question 15 options:

It cannot be done.

It will insert automatically if the update document does not exist

indate

upsert
Question 16 (1 point)

Saved
Listen

____ is a compiler directive.


Question 16 options:
Autonomous
Pragma

Subprogram

EXCEPTION

Question 17 (1 point)

Saved
Listen

____ are values passed into the cursor when opened and used in the
SELECT statement of the cursor to determine what value it will contain.
Question 17 options:
Collec�ons

Subqueries

Parameters

Variables

Question 18 (1 point)

Saved
Listen

If a table column data type is modified, no changes to associated


variables are required because the ____ attribute always uses the
column's current data type.
Question 18 options:
TYPE

:=

=>
%TYPE

Question 19 (1 point)

Saved
Listen

Which of the following statements is correct?


Question 19 options:
If mul�ple triggers exist on a table, the order in which the triggers will be fired can be set.

A BEFORE statement level trigger will fire before a BEFORE row level trigger.

If you have two statement level triggers, the order in which they are fired is dependent on the order in which they
were writen.

Only one trigger can be constructed per table.

Question 20 (1 point)

Saved
Listen

____ are saved in an Oracle11g application or library on the client-side.


Question 20 options:
Stored procedure and func�ons

Func�ons

Packages

Applica�on procedures

Question 21 (1 point)

Saved
Listen
Oracle supplies a set of ____ or names associated with common Oracle
errors.
Question 21 options:
predefined excep�ons

looping constructs

excep�on handlers

Searched CASES

Question 22 (1 point)

Saved
Listen

Row level options are only applicable for ____ events.


Question 22 options:
CREATE

INSERT

DECLARE

UPDATE and DELETE

Question 23 (1 point)

Saved
Listen

A parameter with a(n) ____ only mode can receive a value, but this value
cannot be changed in the procedure.
Question 23 options:
IN OUT
IN

OUT

INOUT

Question 24 (1 point)

Saved
Listen

A(n) ____ must be assigned one of three available modes: IN, OUT, IN
OUT.
Question 24 options:
func�on

parameter

package

procedure

Question 25 (1 point)

Saved
Listen

Which of the following indicates that the trigger is fired only once,
regardless of the number of rows affected by the DML statement?
Question 25 options:
Statement level

Event level

DML level

Row level
Question 26 (1 point)

Saved
Listen

What can be used to simplify processing each row of a set retrieved


from a database?
Question 26 options:
CURSOR

CURSOR For LOOP

LOOP

CURSOR Atribute

Question 27 (1 point)

Saved
Listen

If a cursor is declared in a package specification that referenced the


PV_TOTAL_NUM package variable, the variable ____.
Question 27 options:
need not be declared

must be declared a�er the cursor

must be declared as private

must be declared before the cursor

Question 28 (1 point)

Saved
Listen
A(n) ____ is a declaration of a program unit in a package body by placing
the header code at the top of the package body code.
Question 28 options:
package scope

package declara�on

package specifica�on

forward declara�on

Question 29 (1 point)

Saved
Listen

The following code is considered to be a ____.

CREATE OR REPLACE PROCEDURE total_calc_sp


(p_basket IN bb_basket.idbasket%TYPE,
p_total OUT bb_basket.total%TYPE := 0 )
IS
Question 29 options:
func�on header sec�on

PL/SQL block

procedure header sec�on

DECLARE sec�on

Question 30 (1 point)

Saved
Listen
The ____ command can be used to remove procedures.
Question 30 options:
DEL

DROP

DELETE

REMOVE

Question 31 (1 point)

Saved
Listen

A(n) ____ performs tasks automatically when a particular application


event occurs, such as when the user clicks a button on the screen.
Question 31 options:
package

applica�on trigger

stored procedure

database trigger

Question 32 (1 point)

Saved
Listen

____ refers to a SELECT statement in a PL/SQL block that retrieves no


rows.
Question 32 options:
TOO_MANY_ROWS
NO_DATA_FOUND

ZERO_DIVIDE

DUP_VAL_ON_INDEX

Question 33 (1 point)

Saved
Listen

____ a program unit or PL/SQL block of code allows the storage and
reuse of the code.
Question 33 options:
Naming

Processing

Crea�ng

Debugging

Question 34 (1 point)

Saved
Listen

The term ____ refers to program code that resides on the user machine.
Question 34 options:
client-side

client/server

two-�er

server-side
Question 35 (1 point)

Saved
Listen

All of the following represent restrictions on functions, except ____.


Question 35 options:
Func�ons cannot modify any tables in Oracle8i and prior versions.

Func�ons cannot be used in a CHECK constraint or as a default value of a table column.

If used in a remote or parallel opera�on, no reading or wri�ng of packaged variables is allowed.

If used in a SELECT,VALUES, or SET clause, the func�on cannot write values to packaged variables.

Question 36 (1 point)

Saved
Listen

All of the following would cause a trigger to fire, except ____.


Question 36 options:
BEFORE

INSERT

DELETE

UPDATE

Question 37 (1 point)

Saved
Listen
Which of the following correctly creates a function that performs an
update on the BB_TEST1 table?
Question 37 options:
CREATE OR REPLACE FUNCTION fct_test1_sf (p_num IN NUMBER)
RETURN NUMBER
IS
BEGIN
UPDATE bb_test1
SET col1 = p_num;
RETURN p_num;
END;

CREATE OR REPLACE FUNCTION fct_test1_sf (p_num IN NUMBER)


RETURN NUMBER
IS
BEGIN
UPDATE bb_test1;
SET col1 = p_num;
RETURN p_num;
END;

CREATE OR REPLACE FUNCTION fct_test1_sf (p_num)


RETURN NUMBER
IS
BEGIN
UPDATE bb_test1
RETURN p_num;
END;

CREATE OR REPLACE FUNCTION fct_test1_sf (p_num IN NUMBER(6))


RETURN NUMBER
IS
BEGIN
UPDATE bb_test1
SET col1 = p_num;
RETURN p_num
END

Question 38 (1 point)

Saved
Listen

A(n) ____ contains a RETURN clause and is used to manipulate data and
return a single resulting value.
Question 38 options:
procedure

applica�on

func�on

database trigger

Question 39 (1 point)

Saved
Listen

When creating a procedure, each parameter is listed, along with a mode


and ____.
Question 39 options:
func�on

package

variable

data type

Question 40 (1 point)

Saved
Listen

The ____ section of a PL/SQL block addresses two situations: either an


Oracle error is raised or a user-defined error is raised.
Question 40 options:
DECLARE

BEGIN

EXCEPTION

UPDATE

Question 41 (1 point)

Saved
Listen

The statement ____ correctly deletes a trigger.


Question 41 options:
DEL TRIGGER trigger_name;

DELETE TRIGGER trigger_name;

REMOVE TRIGGER trigger_name;

DROP TRIGGER trigger_name;

Question 42 (1 point)

Saved
Listen

Which of the following statements is incorrect?


Question 42 options:
A procedure can serve as an en�re statement.

A func�on is part of an expression.

Procedures can be used in SQL statements.

A func�on cannot serve as an en�re statement.


Question 43 (1 point)

Saved
Listen

Full procedures or function codes are contained in the ____.


Question 43 options:
package specifica�on

package body

package header

anonymous block

Question 44 (1 point)

Saved
Listen

Package elements are considered ____ if they can be called only from
other program units within the same package.
Question 44 options:
public

overloaded

one �me procedures

private

Question 45 (1 point)

Saved
Listen
CREATE OR REPLACE PACKAGE ordering_pkg
IS
pv_total_num NUMBER(3,2);
PROCEDURE order_total_pp
(p_bsktid IN NUMBER,
p_sub OUT NUMBER);

FUNCTION ship_calc_pf
(p_qty IN NUMBER)
RETURN NUMBER;
END;

Based on the package specification above, which of the following code


fragments correctly creates a package body?
Question 45 options:
CREATE OR REPLACE PACKAGE BODY ordering_pkg IS
FUNCTION ship_calc_pf
(p_qty IN NUMBER)
RETURN NUMBER
IS
lv_ship_num NUMBER(5,2);
BEGIN
... code detail ...
END ship_calc_pf;

PROCEDURE order_total_pp
(p_bsk�d IN NUMBER,
p_sub OUT NUMBER)
IS
BEGIN
... code detail ...
END order_total_pp;
END;

CREATE OR REPLACE PACKAGE ordering_pkg IS


FUNCTION ship_calc_pf
(p_qty IN NUMBER)
RETURN NUMBER
IS
lv_ship_num NUMBER(5,2);
BEGIN
... code detail ...
END ship_calc_pf;

PROCEDURE order_total_pp
(p_bsk�d IN NUMBER,
p_sub OUT NUMBER,
IS
BEGIN
... code detail ...
END order_total_pp;
END;

CREATE OR REPLACE PACKAGE BODY ordering_pkg IS


FUNCTION ship_calc_pf
(p_qty IN NUMBER)
RETURN NUMBER
IS
lv_ship_num NUMBER(5,2);
BEGIN
... code detail ...
END ship_calc_pf;

END;

CREATE OR REPLACE PACKAGE BODY order_pkg IS


FUNCTION ship_calc_pf
(p_qty IN NUMBER)
RETURN NUMBER
IS
lv_ship_num NUMBER(5,2);
BEGIN
... code detail ...
END ship_calc_pf;

PROCEDURE order_total_pp
(p_bsk�d IN NUMBER,
p_sub OUT NUMBER)
IS
BEGIN
... code detail ...
END order_total_pp;
END;

You might also like