FA 3 Flashcards

(104 cards)

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
The functions used in SQL statements cannot use _____ or IN OUT modes.
OUT
26
The purpose of the OR REPLACE clause is to ______ an existing procedure.
OVERWRITE
27
The _______ is added to CREATE PROCEDURE clause to overwrite an existing procedure.
OR REPLACE
28
(T OR F) A procedure is compiled and stored in the database as a schema object.
TRUE
29
(T OR F) The DECLARE keyword is not used in a subprogram.
TRUE
30
(T OR F) The Positional parameter passing is the common method of passing parameters.
TRUE
31
(T OR F) To invoke a procedure from another procedure, use a direct call inside an executable section of the block.
TRUE
32
(T OR F) Another way of initializing a default value for parameter is by using assignment operator.
TRUE
33
What is missing in the procedure header? CREATE PROCEDURE raise_sal(p_id IN NUMBER, p_sal IN NUMBER) IS BEGIN ... END;
Procedure name after END
34
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;
3
35
When invoking a function as part of a PL/SQL expression, you can use a _______ to store the returned result.
LOCAL VARIABLE
36
A function can be called as a part of:
PL/SL expression
37
What is missing in the code below? create or replace function sample return number is begin return 5+5; end;
FORMAL PARAMETER
38
A function must have a _______ clause in the header and at least one RETURN statement in the executable section.
RETURN
39
(T OR F) Subprograms are explicitly shared.
TRUE
40
(T OR F) The symbol >> is used for association operator?
FALSE
41
If Combination notation is used, the _______ parameters must come first.
POSITIONAL
42
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
2
43
How many value is returned by a function?_____
SINGLE VALUE/1/ONE ^
44
In stored function, the RETURN clause is used instead of ____ mode.
OUT
45
In PL/SQL ___________, the function identifier acts like a variable whose value depends on the parameters passed to it.
EXPRESSION
46
What is missing in the code below? create or replace function sample return number is num number(2); begin num := 5+5; end;
No return value
47
In the given Procedure header, the ________clause is optional. CREATE OR REPLACE PROCEDURE name [parameters] IS|AS
IS|AS
48
The executable section of the procedure body requires a minimum of _____ statement.
ONE
49
Using an _______ parameter mode, you can pass a value into a procedure that can be updated within the procedure.
IN OUT
50
The _____ are named PL/SQL blocks that are compiled and stored in the database.
PROCEDURE
51
The _____ are named PL/SQL blocks that are compiled and stored in the database.
OVERWRITE
52
The type of parameter that is declared in procedure heading is called ________.
FORMAL
53
The operator => is called _______.
ASSOCIATION OPERATOR
54
A function must have a RETURN clause in the _____ and at least one RETURN statement in the executable section.
HEADER
55
In stored function, the parameter mode should only be ______ .
IN
56
The _______ is added to CREATE PROCEDURE clause to overwrite an existing procedure.
OR REPLACE
57
In Procedure, the default parameter mode is _______.
IN
58
Which type of parameter passing uses an association operator?
NAMED
59
Three ways of passing parameters from the calling environment:
POSITIONAL, NAMED, COMBINATION
60
In stored function, the ______ clause is used instead of OUT mode
RETURN
61
A stored function must return exactly ____ value.
ONE
62
(T OR F) Parameters in subprograms are optional.
TRUE
63
(T OR F) If Combination notation is used, the positional parameters must come first before the named parameters.
TRUE
64
(T OR F) Subprograms are explicitly shared.
TRUE
65
(T OR F) Subprograms become the building blocks of packages and triggers.
TRUE
66
(T OR F) The block structure of the subprograms is similar to the structure of anonymous blocks.
TRUE
67
(T OR F) A procedure can be invoked in another procedure.
TRUE
68
(T OR F) Another way of initializing a default value for parameter is by using assignment operator.
TRUE
69
(T OR F) To invoke a procedure from another procedure, use a direct call inside an executable section of the block
TRUE
70
(T OR F) The Positional parameter passing is the common method of passing parameters.
TRUE
71
The block structure of the subprograms is similar to the structure of _____ blocks.
ANONYMOUS
72
(T OR F) The formal parameters can be literal values, variables, or expressions that are sent to the parameter list of a called subprogram.
FALSE (ACTUAL)
73
(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.
FALSE
74
(T OR F) The positional parameter passing uses the associate operator.
FALSE
75
(T OR F) The code below is a correct example of passing parameters by combination notation. add_dept (p_loc=>1400, 'EDUCATION' );
FALSE
76
(T OR F) The OUT parameter mode supplies an input value, which can be returned (output) as a modified value.
FALSE
77
(T OR F) The symbol >> is used for association operator?
FALSE
78
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);
THE NAMED PARAMETER
79
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;
3
80
What is missing in the code below? create or replace function sample is num number(2); begin num := 5+5; return num; End;
NO RETURN VALUE
81
create or replace function sample return number is begin return 5+5; end;
NOTHING IS MISSING
82
(T OR F) The DEFAULT keyword is used to assign a default value for formal parameters
FALSE
83
(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.
TRUE
84
(T OR F) The code below is a correct example of passing parameters by combination notation. add_dept (p_loc=>1400, 'EDUCATION' )
FALSE
85
(T OR F) The Named parameter passing is the common method of passing parameters.
FALSE
86
(T OR F) Using an _______ parameter mode, you can pass a value into a procedure that can be updated within the procedure.
IN OUT
87
The parameter modes are specified in:
FORMAL PARAMETER
88
How many value is returned by a function?_____
1
89
Subprograms are named PL/SQL blocks that are compiled and stored in the _______.
DATABASE
90
Which keyword is omitted in the declaration section of the procedure? _____
DECLARE
91
(T OR F) The DECLARE keyword is not used in a subprogram.
TRUE
92
(T OR F) The code below is a correct example of passing parameters by combination notation. add_dept (p_loc=>1400, 'EDUCATION' );
FALSE
93
(T OR F) The IN parameters can only be read within the procedure and cannot be modified.
TRUE
94
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
95
(T OR F) The IN mode parameters may or may not be specified
TRUE
96
The _____ are named PL/SQL blocks that are compiled and stored in the database.
SUBPROGRAMS
97
(T OR F) The IN mode parameters may or may not be specified.
TRUE
98
(T OR F) The Positional parameter passing is the common method of passing parameters.
TRUE
99
(T OR F) If Combination notation is used, the positional parameters must come first before the named parameters.
TRUE
100
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;
0
101
The functions used in SQL statements cannot use OUT or _____ modes.
IN OUT
102
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];
FUNCTION
103
The functions used in SQL statements cannot use ____ or IN OUT modes.
IN
104
(T OR F) Parameters in subprograms are optional.
TRUE