FA 3 Flashcards

1
Q

These subprograms are compiled and stored in the database

A

Subprograms

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

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

A

anonymous

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

(T OR F) You cannot invoke a procedure from inside a SQL statement such as SELECT

A

TRUE

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

(T OR F) Subprograms are implicitly shared

A

FALSE

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

(T OR F) Later subprograms become the building blocks of packages and triggers.

A

TRUE

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

(T OR F) In Procedure, all parameters must not be specified

A

FALSE

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

(T OR F) The functions used in SQL statements cannot use OUT or IN OUT modes.

A

TRUE

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

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

A

EXPRESSIONS

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

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

A

TRUE

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

The executable section of the procedure body requires a minimum of _____ statement.

A

1**

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

In anonymous block, DECLARE states “this is the start of a block”. In Procedure, ____________ states “this is the start of a subprogram”.

A

CREATE PROCEDURE

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

Subprograms are named PL/SQL blocks that are compiled and stored in the _______.

A

DATABASE

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

(T OR F) In Procedure, all parameter modes must be specified

A

TRUE

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

(T OR F) Another way of initializing a default value for parameter is by using assignment operator.

A

TRUE

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

(T OR F) The DEFAULT keyword is used to assign a default value for formal parameters.

A

TRUE

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

(T OR F) 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.

A

FALSE (PARAMETERS)

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

(T OR F) The positional parameter passing uses the associate operator.

A

FALSE

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

(T OR F) A procedure can be invoked in another procedure.

A

TRUE

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

Using an _______ parameter mode, you can pass a value into a procedure that can be updated within the procedure.

A

IN OUT

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

What is the symbol used for association operator?

A

=>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
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 IS
BEGIN
update employees
set salary = salary + (salary * (emp_raise/100) where employee_id = emp;
END;

A

Procedure name after END keyword

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

What is the error of the given code?
BEGIN
add_dept(name =>’new dept’, ‘new location’);
END;

A

Positional parameter must come before named parameter**

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

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

A

ACTUAL

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

Functions return only a single value, and the value is returned through a ______ statement.

A

RETURN

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

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

A

OUT

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

The purpose of the OR REPLACE clause is to ______ an existing procedure.

A

OVERWRITE

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

The _______ is added to CREATE PROCEDURE clause to overwrite an existing procedure.

A

OR REPLACE

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

(T OR F) A procedure is compiled and stored in the database as a schema object.

A

TRUE

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

(T OR F) The DECLARE keyword is not used in a subprogram.

A

TRUE

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

(T OR F) The Positional parameter passing is the common method of passing parameters.

A

TRUE

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

(T OR F) To invoke a procedure from another procedure, use a direct call inside an executable section of the block.

A

TRUE

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

(T OR F) Another way of initializing a default value for parameter is by using assignment operator.

A

TRUE

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

What is missing in the procedure header?
CREATE PROCEDURE raise_sal(p_id IN NUMBER, p_sal IN NUMBER) IS
BEGIN

END;

A

Procedure name after END

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
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;

A

3

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

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

A

LOCAL VARIABLE

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

A function can be called as a part of:

A

PL/SL expression

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

What is missing in the code below?
create or replace function sample
return number
is
begin
return 5+5;
end;

A

FORMAL PARAMETER

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

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

A

RETURN

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

(T OR F) Subprograms are explicitly shared.

A

TRUE

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

(T OR F) The symbol&raquo_space; is used for association operator?

A

FALSE

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

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

A

POSITIONAL

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

How many parameters are there in the given code?
CREATE or replace procedure raise_sal
(empid my_employees.employee_id%TYPE := 1234, emp_raise number) IS
BEGIN

A

2

43
Q

How many value is returned by a function?_____

A

SINGLE VALUE/1/ONE ^

44
Q

In stored function, the RETURN clause is used instead of ____ mode.

A

OUT

45
Q

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

A

EXPRESSION

46
Q

What is missing in the code below?
create or replace function sample
return number
is num number(2);
begin
num := 5+5;
end;

A

No return value

47
Q

In the given Procedure header, the ________clause is optional.
CREATE
OR
REPLACE
PROCEDURE
name
[parameters]
IS|AS

A

IS|AS

48
Q

The executable section of the procedure body requires a minimum of _____ statement.

A

ONE

49
Q

Using an _______ parameter mode, you can pass a value into a procedure that can be updated within the procedure.

A

IN OUT

50
Q

The _____ are named PL/SQL blocks that are compiled and stored in the database.

A

PROCEDURE

51
Q

The _____ are named PL/SQL blocks that are compiled and stored in the database.

A

OVERWRITE

52
Q

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

A

FORMAL

53
Q

The operator => is called _______.

A

ASSOCIATION OPERATOR

54
Q

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

A

HEADER

55
Q

In stored function, the parameter mode should only be ______ .

A

IN

56
Q

The _______ is added to CREATE PROCEDURE clause to overwrite an existing procedure.

A

OR REPLACE

57
Q

In Procedure, the default parameter mode is _______.

A

IN

58
Q

Which type of parameter passing uses an association operator?

A

NAMED

59
Q

Three ways of passing parameters from the calling environment:

A

POSITIONAL, NAMED, COMBINATION

60
Q

In stored function, the ______ clause is used instead of OUT mode

A

RETURN

61
Q

A stored function must return exactly ____ value.

A

ONE

62
Q

(T OR F) Parameters in subprograms are optional.

A

TRUE

63
Q

(T OR F) If Combination notation is used, the positional parameters must come first before the named parameters.

A

TRUE

64
Q

(T OR F) Subprograms are explicitly shared.

A

TRUE

65
Q

(T OR F) Subprograms become the building blocks of packages and triggers.

A

TRUE

66
Q

(T OR F) The block structure of the subprograms is similar to the structure of anonymous blocks.

A

TRUE

67
Q

(T OR F) A procedure can be invoked in another procedure.

A

TRUE

68
Q

(T OR F) Another way of initializing a default value for parameter is by using assignment operator.

A

TRUE

69
Q

(T OR F) To invoke a procedure from another procedure, use a direct call inside an executable section of the block

A

TRUE

70
Q

(T OR F) The Positional parameter passing is the common method of passing parameters.

A

TRUE

71
Q

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

A

ANONYMOUS

72
Q

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

A

FALSE (ACTUAL)

73
Q

(T OR F) 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.

A

FALSE

74
Q

(T OR F) The positional parameter passing uses the associate operator.

A

FALSE

75
Q

(T OR F) The code below is a correct example of passing parameters by combination notation.
add_dept (p_loc=>1400, ‘EDUCATION’ );

A

FALSE

76
Q

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

A

FALSE

77
Q

(T OR F) The symbol&raquo_space; is used for association operator?

A

FALSE

78
Q

Assuming add_dept procedure has two parameters: p_name and p_id, what is the error
in the given procedure call?
add_dept (‘ADVERTISING’, p_loc => 1400);

A

THE NAMED PARAMETER

79
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;

A

3

80
Q

What is missing in the code below?
create or replace function sample
is num number(2);
begin
num := 5+5;
return num;
End;

A

NO RETURN VALUE

81
Q

create or replace function sample
return number
is
begin
return 5+5;
end;

A

NOTHING IS MISSING

82
Q

(T OR F) The DEFAULT keyword is used to assign a default value for formal parameters

A

FALSE

83
Q

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

A

TRUE

84
Q

(T OR F) The code below is a correct example of passing parameters by combination notation.
add_dept (p_loc=>1400, ‘EDUCATION’ )

A

FALSE

85
Q

(T OR F) The Named parameter passing is the common method of passing parameters.

A

FALSE

86
Q

(T OR F) Using an _______ parameter mode, you can pass a value into a procedure that can be updated within the procedure.

A

IN OUT

87
Q

The parameter modes are specified in:

A

FORMAL PARAMETER

88
Q

How many value is returned by a function?_____

A

1

89
Q

Subprograms are named PL/SQL blocks that are compiled and stored in the
_______.

A

DATABASE

90
Q

Which keyword is omitted in the declaration section of the procedure? _____

A

DECLARE

91
Q

(T OR F) The DECLARE keyword is not used in a subprogram.

A

TRUE

92
Q

(T OR F) The code below is a correct example of passing parameters by combination
notation.
add_dept (p_loc=>1400, ‘EDUCATION’ );

A

FALSE

93
Q

(T OR F) The IN parameters can only be read within the procedure and cannot be modified.

A

TRUE

94
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;

A

2

95
Q

(T OR F) The IN mode parameters may or may not be specified

A

TRUE

96
Q

The _____ are named PL/SQL blocks that are compiled and stored in the database.

A

SUBPROGRAMS

97
Q

(T OR F) The IN mode parameters may or may not be specified.

A

TRUE

98
Q

(T OR F) The Positional parameter passing is the common method of passing parameters.

A

TRUE

99
Q

(T OR F) If Combination notation is used, the positional parameters must come first before the named parameters.

A

TRUE

100
Q

What is the error of the given code?
BEGIN
add_dept(name =>’new dept’, ‘new location’);
END;
- Positional parameter must come before named parameter
How many private variables are there in the given code?
CREATE or replace procedure raise_sal
(empid my_employees.employee_id%TYPE := 1234, emp_raise number) IS
BEGIN
update employees
set salary = salary + (salary * (emp_raise/100) where employee_id = emp;
END;

A

0

101
Q

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

A

IN OUT

102
Q

What keyword is missing in the given function construct?
CREATE [OR REPLACE] function_name
[(parameter1 [mode1] datatype1, …)]
RETURN datatype IS|AS
[local_variable_declarations; …]
BEGIN
actions;
RETURN expression;
END [function_name];

A

FUNCTION

103
Q

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

A

IN

104
Q

(T OR F) Parameters in subprograms are optional.

A

TRUE