SA2 DBS - Sheet1 Flashcards

1
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
2
Q

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

A

DECLARE

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

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

A

True

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

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
6
Q

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
7
Q

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

A

False

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

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
9
Q

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

A

FORMAL

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?

A

All the options

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

Which parameter mode can be assigned a default value?
IN
OUT
IN OUT

A

IN

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

How many value is returned by a function?_____

A

1

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

A stored function must return exactly ____ value.

A

one

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

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

A

IN

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

What is missing in the code below?

create or replace function sample

return number

is

begin

return 5+5;

end;

Group of answer choices

Formal parameter

Nothing is missing

Expression evaluation

Variable

A

Nothing is missing

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

Which of the statement below is valid? Assuming that get_sal procedure exists with one OUT parameter.

Group of answer choices

x:=100; DBMS_OUTPUT.PUT_LINE(get_sal(x));

All the options

x:= 200; DBMS_OUTPUT.PUT_LINE(get_sal(100+x));

PUT_LINE(get_sal(100));

A

x:=100; DBMS_OUTPUT.PUT_LINE(get_sal(x));

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

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

A

SUBPROGRAMS

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

The DECLARE keyword is not used in a subprogram.
Group of answer choices

True

False

A

True

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

In Procedure, all parameter modes must be specified.
Group of answer choices

True

False

A

False

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

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

True

False

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

The Named parameter passing is the common method of passing parameters.
Group of answer choices

True

False

A

False

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

The DEFAULT keyword is used to assign a default value for formal parameters.
Group of answer choices

True

False

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is the symbol used for association operator? Group of answer choices = >> => >=
=>
26
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); Group of answer choices No error The value of the positional parameter The named parameter Positional parameter must come before named parameter
The named parameter
27
If Combination notation is used, the _______ parameters must come first. Group of answer choices POSITIONAL NAMED
POSITIONAL
28
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
29
Functions return only a single value, and the value is returned through a ______ statement.
RETURN
30
A function must have a _______ clause in the header and at least one RETURN statement in the executable section. Group of answer choices PARAMETER DECLARATION RETURN EXIT
RETURN
31
What follows the RETURN keyword at the function header? Group of answer choices IS PARAMETER VARIABLE DATA TYPE
DATA TYPE
32
The _______ is added to CREATE PROCEDURE clause to overwrite an existing procedure.
OR REPLACE
33
Subprograms become the building blocks of packages and triggers. Group of answer choices True False
True
34
If Combination notation is used, the positional parameters must come first before the named parameters. Group of answer choices True False
True
35
To invoke a procedure from another procedure, use a direct call inside an executable section of the block. Group of answer choices True False
t
36
Given the procedure below, what is the correct way of invoking the procedure? CREATE OR REPLACE PROCEDURE show_emps (p_emp_id IN NUMBER, p_department_id IN number, p_hiredate IN DATE) IS begin . . . . . . End; Group of answer choices show_emps(101, p_hiredate => ’01-dec-2007’, p_department_id = 10) Show_emps(101, 10, ’01-dec-2006’); show_emps(p_department_id => 10, p_hiredate => ’01-dec-1007’, p_emp_id => 101) All the options
show_emps(p_department_id => 10, p_hiredate => ’01-dec-1007’, p_emp_id => 101)
37
The operator => is called _______. Group of answer choices Associate operator Association operator Referencing operator Reference operator
Association operator
38
Using an _______ parameter mode, you can pass a value into a procedure that can be updated within the procedure. Group of answer choices OUT IN All the options IN OUT
IN OUT
39
Which type of parameter passing uses an association operator? Group of answer choices Positional IN OUT Combination Named
Named
40
The functions used in SQL statements cannot use OUT or _____ modes.
IN OUT
41
Which of the statement below is valid? Assuming that get_sal function exists with no parameter. Group of answer choices v_salary := get_sal() + 50; get_sal + 50; v_salary := get_sal + 50; get_sal() + 50;
v_salary := get_sal() + 50;
42
What is missing in the code below? create or replace function sample is num number(2); begin num := 5+5; return num; end; Group of answer choices Formal parameter Not in the options Size of the returning value No return value
No return value
43
The functions used in SQL statements cannot use OUT or _____ modes. Group of answer choices IN IN OUT
IN OUT
44
In the given Procedure header, the ________clause is optional. CREATE OR REPLACE PROCEDURE name [parameters] IS|AS
OR REPLACE
45
The block structure of the subprograms is similar to the structure of anonymous blocks. Group of answer choices True False
True
46
The IN mode parameters may or may not be specified. Group of answer choices True False
True
47
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. Group of answer choices True False
False
48
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; Group of answer choices Procedure name after END keyword Not in the options Nothing is missing Incomplete declaration of emp_raise parameter IN
Procedure name after END keyword
49
What is the error of the given code? BEGIN add_dept(name =>'new dept', 'new location'); END; Group of answer choices Positional parameter must come before named parameter Invoking the procedure Actual parameter values Do not enclose parameter values with single quote
Positional parameter must come before named parameter
50
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; Group of answer choices 2 3 1 0
2
51
What is missing in the code below? create or replace function sample return number is num number(2); begin num := 5+5; end; Group of answer choices Size of the returning value No return value Formal parameter Incomplete expression
No return value
52
The block structure of the subprograms is similar to the structure of _____ blocks.
ANONYMOUS
53
The executable section of the procedure body requires a minimum of _____ statement.
ONE
54
In the given Procedure header, the underlined clause/keyword is optional. CREATE OR REPLACE PROCEDURE name [parameters] IS|AS Group of answer choices True False
False
55
A procedure is a PL/SQL block containing local variables, a BEGIN, and an END. The procedure_name after the END keyword is mandatory. Group of answer choices True False
False
56
Three ways of passing parameters from the calling environment: Group of answer choices POSITIONAL, NAMED, COMBINATION POSITION, NAME, COMBINATION POSITIONAL, NAMED, COMBINATIONAL d. POSITION, NAMED, COMBINATION
POSITIONAL, NAMED, COMBINATION
57
A ______ is a named PL/SQL block that returns exactly one value.
FUNCTION
58
The functions used in SQL statements cannot use _____ or IN OUT modes.
IN
59
Which of the statement below is valid? Assuming that get_sal function exists with parameter. Group of answer choices get_sal + 50; get_sal() + 50; v_salary := get_sal() + 50; Not in the options
get_sal() + 50;
60
You cannot invoke a procedure from inside an SQL statement. Group of answer choices True False
True
61
A procedure can be invoked in another procedure. Group of answer choices True False
True
62
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 update employees set salary = salary + (salary * (emp_raise/100) where employee_id = emp; END; Group of answer choices 1 2 3 0
2
63
In stored function, the parameter mode should only be ______ .
IN
64
In Procedure, the default parameter mode is IN. Group of answer choices True False
True
65
Procedures may have an exception section. Group of answer choices True False
True
66
The parameter modes are specified in: Group of answer choices ACTUAL PARAMETER FORMAL PARAMETER
FORMAL PARAMETER
67
In stored function, the RETURN clause is used instead of ____ mode.
OUT
68
A function must have a RETURN clause in the _____ and at least one RETURN statement in the executable section.
HEADER
69
In Procedure, the default parameter mode is _______.
IN
70
Parameters in subprograms are optional. Group of answer choices True False
t
71
Another way of initializing a default value for parameter is by using assignment operator. Group of answer choices True False
True
72
The OUT parameter mode supplies an input value, which can be returned (output) as a modified value. Group of answer choices True False
False
73
The _____ are containers that enable you to group together related PL/SQL subprograms, variables, cursors, and exceptions.
PACKAGES
74
What is missing in the given construct in order to remove an entire package? DROP ________ PACKAGE_NAME;
PACKAGES
75
The ____ option drops and re-creates the package specification.
OR REPLACE
76
The OR REPLACE option deletes an existing package bod
77
The OR REPLACE option overwrite an existing package body.
t
78
What is missing in the given package body construct? CREATE [OR REPLACE] PACKAGE package_name IS|AS private type and variable declarations subprogram bodies [BEGIN initialization statements] END [package_name];
BODY
79
The package specification should contain the subprogram ________ and associated parameters terminated by a semicolon.
NAME
80
The package body contains the executable code of the _________ which were declared in the package specification. It may also contain its own variable declarations.
SUBPROGRAMS
81
Variables declared in the package body are considered private.
t
82
You need to recompile the package specification whenever the body of the subprograms that are in the package body changes.
83
Package construct (variable, procedure, function, and so on) that can be seen and executed from _____ the package are considered public.
OUTSIDE
84
The OR REPLACE options _______ and re-creates the package specification.
DROPS
85
Using the package name after the END keyword is mandatory.
86
One of the reason for using packages is encapsulation wherein related programs and variables are grouped together.
t
87
The implementation (i.e., the detailed code) of a procedure or function that is declared in a ________ is done in the package body.
PACKAGE SPECIFICATION
88
Package body contains only subprograms that are declared in the package specification.
89
The OR REPLACE option overwrite an existing package body.
t