FORMATIVE 3 Flashcards

1
Q

The block structure of the subprograms is similar to the structure of (ANONYMOUS) blocks.

True or False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The (SUBPROGRAMS) are named PL/SQL bocks that are compiled and stored in the database.

True or False

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A procedure is a PL/SQL block containing local variables, a BEGIN, and an END. The procedure_name after the END keyword is optional.

True or False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

You can invoke a procedure from inside an SQL statement.

True or False

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

To invoke a procedure from another procedure, use a direct call inside an executable section of the block.

True or False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The formal parameters can be literal values, variables, or expressions that are sent to the parameter list of a called subprogram.

True or False

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A procedure can be invoked in another procedure.

True or False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The IN parameters can only be read within the procedure and cannot be modified.

True or False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The DEFAULT keyword is used to assign a default value for formal parameters.

True or False

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which can be used to assign a default value to IN parameters?

:=

Assignment operator

DEFAULT

All the options

A

All the options

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The parameter modes are specified in:

FORMAL PARAMETER

ACTUAL PARAMETER

A

FORMAL PARAMETER

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

The type of parameter that is declared in procedure heading is called ______.

ACTUAL

FORMAL

A

FORMAL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which type of parameter passing uses an association operator?

Positional

Named

IN OUT

Combination

A

Named

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When invoking a function as part of a PL/SQL expression, you can use a (LOCAL VARIABLE) to store the returned result.

True or False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In PL/SQL (EXPRESSIONS), the function identifier acts like a variable whose value depends on the parameters passed to it.

True or False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The functions used in SQL statements cannot use ____ or IN OUT modes.

OUT

IN

A

OUT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

The (OR REPLACE) is added to CREATE PROCEDURE clause to overwrite an existing procedure.

True or False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

In Procedure, the default parameter mode is (IN).

True or False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

In anonymous block, DECLARE states “this is the start of a block”. In Procedure, (CREATE PROCEDURE) states “this is the start of a subprogram”.

True or False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

The positional parameter passing uses the associate operator.

True or False

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

The Positional parameter passing is the common method of passing parameters.

True or False

21
Q

Another way of initializing a default value for parameter is by using assignment operator.

True or False

22
Q

A function must have a (RETURN) clause in the header and at least one RETURN statement in the executable section..

True or False

23
Q

The purpose of the OR REPLACE clause is to (OVERWRITE) an existing procedure.

True

False

24
Q

A procedure is compiled and stored in the database as a schema object.

True

False

25
Q

In the given Procedure header, the underlined clause/keyword is optional.

CREATE OR REPLACE PROCEDURE name [parameters] IS|AS

True

False

26
Q

The actual is a special form of a variable, whose input values are initialized by the calling environment when the subprogram is called, and whose output values are returned to the calling environment when the subprogram returns control to the caller.

True

False

27
Q

The OUT parameter mode supplies an input value, which can be returned (output) as a modified value.

True

False

28
Q

If Combination notation is used, the positional parameters must come first before the named parameters.

True

False

29
Q

If Combination notation is used, the _______ parameters must come first.

POSITIONAL

NAMED

A

POSITIONAL

30
Q

The _____ parameters can be literal values, vairables, or expressions that are sent to the paramter list ofa called subprogram.

FORMAL

ACTUAL

31
Q

Which parameter mode can be assigned a default value?

IN
OUT
IN OUT

IN

OUT

IN OUT

32
Q

A stored function must return exactly (ONE) value.

True

False

33
Q

Subprograms are named PL/SQL blocks that are compiled and stored in the (DATABASE).

True

False

34
Q

Subprograms are implicitly shared.

True

False

35
Q

Subprograms are explicitly shared.

True

False

36
Q

The operator => is called ______.

Referencing operator

Reference operator

Associate operator

Association operator

A

Association operator

37
Q

The functions used in SQL statement cannot used OUT or ____ modes.

IN

IN OUT

38
Q

What follows the RETURN keyword at the function header?

VARIABLE

DATA TYPE

IS

PARAMETER

39
Q

The block structure of the subprograms is similar to the structure of anonymous blocks.

True

False

40
Q

In the given Procedure header, the underlined clause/keyword is optional.

CREATE OR REPLACE PROCEDURE name [parameters] IS|AS

True

False

41
Q

We can assign a default value to parameters.

True

False

42
Q

What is missing in the given code below?

CREATE or replace procedure raise_sal

       (empid my_employees.employee_id%TYPE := 1234, emp_raise number)

BEGIN

    update employees

    set salary = salary + (salary * (emp_raise/100) where employee_id =  emp;

END;

Nothing is missing

Not in the options

IN

A

Not in the options

43
Q

A function can be called as a part of:

Not in the options

SQL statement

SQL statement, PL/SQL expression

PL/SL expressoin

A

SQL statement, PL/SQL expression

44
Q

In the given Procedure header, the ________clause is optional.

CREATE OR REPLACE PROCEDURE name [parameters] IS|AS

OR REPLACE

True

False

45
Q

You cannot invoke a procedure from inside an SQL statement.

True

False

46
Q

The Named parameter passing is the common method of passing parameters.

True

False

47
Q

The code below is a correct example of passing parameters by combination notation.

add_dept (p_loc=>1400, ‘EDUCATION’ );

Group of answer choices

True

False

48
Q

Given the procedure below, how many parameters will return a value to the calling environment?

CREATE OR REPLACE PROCEDURE show_emps

(p_emp_id NUMBER, p_department_id OUT number,

p_hiredate IN OUT DATE) IS

begin

  . . . . . .

End;

2

0

1

3

49
Q

In stored function, the parameter mode should only be (IN)

True

False

50
Q

What is missing in the code below?

create or replace function sample

return number

is

begin

return 5+5;

end;

Variable

Nothing is missing

Formal parameter

Expression evaluation

A

Nothing is missing