[F2-FORMATIVE] Formative Assessment 2

0.0(0)
studied byStudied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/117

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:14 PM on 2/4/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

118 Terms

1
New cards

A ________ allows us to declare a variable as a record based on a particular table's structure.

%ROWTYPE

2
New cards

Given the code below:

DECLARE

v_emp_record employees%rowtype;

BEGIN

SELECT * INTO v_emp_record FROM employees WHERE employee_id = 100;

DBMS_OUTPUT.PUT_LINE('Email for ' || _____________.first_name ||

' ' || ____________.last_name);

END;

What is missing in the DBMS_OUTPUT section?

V_EMP_RECORD

3
New cards

Always add exception handlers whenever there is a possibility of an error occurring.

Group of answer choices

True

False

True

4
New cards

Each ________ is consists of a WHEN clause, which specifies an exception name.

HANDLER

5
New cards

Use the %ISOPEN cursor attribute before performing a fetch to test whether the cursor is open.

Group of answer choices

True

False

True

6
New cards

The exception section begins with the keyword _______.

EXCEPTION

7
New cards

The RAISE keyword is used in user-defined exception for error notification.

Group of answer choices

True

False

True

8
New cards

Type and record declared in the outer block are visible only in the outer block.

Group of answer choices

True

False

False

9
New cards

The user-defined exceptions are declared within the declarative section and are raised implicitly.

Group of answer choices

True

False

False

10
New cards

When an exception is raised, control immediately shifts to the _______ and the appropriate handler in the exception section is executed.

EXCEPTION SECTION

11
New cards

What keyword is missing in the given syntax of user-define record? ______

TYPE type_name RECORD

(field_declaration[,field_declaration]...);

identifier typename ;

IS

12
New cards

PL/SQL records contain one or more components/fields of any _______ or composite type.

SCALAR

13
New cards

QUESTION WITH IMAGES

https://docs.google.com/document/d/10_q6Eho115iXj64taBqd_Q2eSvJTqaAnt_yDCmpS87k/edit?usp=sharing

14
New cards

In trapping a user-defined exception, these steps must be followed: DECLARE -> RAISE -> __________.

Group of answer choices

Not in the options

Exception Handling

Reference

Identify Exception

Reference

15
New cards

You must include the FOR UPDATE clause in the cursor query so that the rows are unlocked on OPEN.

Group of answer choices

True

False

False

16
New cards

Given the code below:

1. DECLARE

2. CURSOR cur_emps

3. SELECT employee_id, last_name FROM employees;

4. BEGIN

5. FOR v_emp_record IN cur_emps LOOP

6. EXIT WHEN cur_emps%ROWCOUNT > 5;

7. DBMS_OUTPUT.PUT_LINE(v_emp_record.employee_id || ' ' || v_emp_record.last_name);

8. END LOOP;

9. END;

What is the error in line 5?

Group of answer choices

..

Counter variable

No error

Lower bound and upper bound value

Counter variable

17
New cards

Exception handlers are code that defines the recovery actions to be performed when execution-time errors occur.

Group of answer choices

True

False

True

18
New cards

Exception section is mandatory in PL/SQL block.

Group of answer choices

True

False

False

19
New cards

In exception section, the WHEN clause if followed by a condition.

Group of answer choices

True

False

False

20
New cards

Each exception handler is consists of a WHEN clause, which specifies an exception name.

Group of answer choices

True

False

True

21
New cards

Code that defines the recovery actions to be performed when execution-time errors occur.

EXCEPTION HANDLER

22
New cards

The term RAISE in exceptions is the same as handling any error by including corresponding exception handler.

Group of answer choices

True

False

False

23
New cards

The _______ is an optional exception-handling clause that traps any exceptions that have not been explicitly handled.

OTHERS

24
New cards

Given the code below:

DECLARETYPE person_dept IS . . . . . . . .

v_person_dept_rec person_dept;BEGINSELECT e.first_name, e.last_name, d.department_name INTO _____________FROM employees e JOIN departments dON e.department_id = d.department_id WHERE employee_id = 200;DBMS_OUTPUT.PUT_LINE(v_person_dept_rec.first_name || ' ' || v_person_dept_rec.last_name || ' is in the ' || v_person_dept_rec.department_name || ' department.');END;

What is missing in the SELECT section? _________

V_PERSON_DEPT_REC

25
New cards

TYPE and ________ are composite structures.

RECORD

26
New cards

Given the declaration below:

DECLARE

TYPE person_dept IS _________

first_name employees.first_name%TYPE,

last_name employees.last_name%TYPE,

department_name departments.department_name%TYPE;

What is missing in the TYPE section?__________

RECORD

27
New cards

In explicit cursor, you need to fetch each row one at a time.

Group of answer choices

True

False

True

28
New cards

The FETCH statement positions the cursor pointer at the first row.

Group of answer choices

True

False

False

29
New cards

The OPEN will populate the cursor's active set with the result of the SELECT statement in the cursor's definition?

Group of answer choices

True

False

True

30
New cards

The term ________ in exceptions is the same as handling any error by including corresponding exception handler.

TRAPPING

31
New cards

Error in PL/SQL is known as ____________.

EXCEPTION

32
New cards

The OTHERS is mandatory exception-handling clause that traps any exceptions that have not been explicitly handled.

Group of answer choices

True

False

False

33
New cards

The ________ clause is used in user-defined exception to tell the compiler to associate an exception name with a specific Oracle error

Group of answer choices

RAISE_APPLICATION_ERROR

PRAGMA EXCEPTION_INIT

Not in the options

SQLCODE, SQLERRM

PRAGMA EXCEPTION_INIT

34
New cards

The given syntax in declaring a user-define record is correct.

TYPE type_name IS RECORD

(field_declaration[,field_declaration]...);

identifier type_name ;

Group of answer choices

True

False

True

35
New cards

The FETCH will populate the cursor's active set with the result of the SELECT statement in the cursor's definition?

Group of answer choices

True

False

True

36
New cards

Use the ISOPEN cursor attribute before performing a fetch to test whether the cursor is open.

Group of answer choices

True

False

False

37
New cards

The following statements are examples of exception handler.

Entering an expiration date that has passed

Selecting more than one row into a single variablE

Receiving "no rows returned" from a select statement

Group of answer choices

True

False

False

38
New cards

The term TRAP in exceptions is the same as handling any error by including corresponding exception handler.

Group of answer choices

True

False

True

39
New cards

The following statements are examples of exception.

Entering an expiration date that has passed

Selecting more than one row into a single variable

Receiving "no rows returned" from a select statement

Group of answer choices

True

False

True

40
New cards

Each exception handler is consists of a _____ clause, which specifies an exception name.

WHEN

41
New cards

You must include the FOR UPDATE clause in the cursor query so that the rows are locked on _____.

OPEN

42
New cards

What is missing in the given exception syntax? ____

EXCEPTION

WHEN exception1 [OR exception2 . . .]

statement1; statement2;

THEN

43
New cards

The OTHERS is an optional exception-handling clause that traps any exceptions that have not been explicitly handled.

Group of answer choices

True

False

True

44
New cards

The RAISE statement can be used to raise either user-defined or ________ exception.

Group of answer choices

NON-PREDEFINED

PREDEFINED

PREDEFINED

45
New cards

In explicit cursor operations, the set of rows returned by a multiple-row query is called RECORD SET.

Group of answer choices

True

False

False

46
New cards

You can use the EXCEPTION_INIT procedure to return user-defined error messages from stored subprograms.

Group of answer choices

True

False

False

47
New cards

You can use the ________________ procedure to return user-defined error messages from stored subprograms.

Group of answer choices

PRAGMA EXCEPTION_INIT

SQLCODE

RAISE_APPLICATION_ERROR

SQLERRM

RAISE_APPLICATION_ERROR

48
New cards

An exception occurs when an error is discovered during the execution of a program that disrupts the normal operation of the program.

Group of answer choices

True

False

True

49
New cards

Start with the _____ keyword to define a user-defined record structure.

TYPE

50
New cards

The NOWAIT keyword is optional in the FOR UPDATE clause.

Group of answer choices

True

False

True

51
New cards

In explicit cursor operations, the set of rows returned by a multiple-row query is called ________.

Group of answer choices

Active set

Record set

Active Cursor

Cursor

Active set

52
New cards

What are/is the type of exception can be raised using the RAISE statement?

Group of answer choices

Pre-defined, User-defined

User-defined

NON-PREDEFINED

Non-predefined, User-defined

Pre-defined, Non-predefined

Pre-defined, User-defined

53
New cards

Non-predefined errors are raised explicitly.

Group of answer choices

True

False

False

54
New cards

What symbol is used to terminate the TYPE statement?

DECLARE

TYPE person_dept IS . . . . . . . .

END

55
New cards

What keyword is missing in the given syntax of user-define record? ___________

TYPE type_name IS

(field_declaration[,field_declaration]...);

identifier typename ;

RECORD

56
New cards

The cursor defined in the code below is _______.

1. DECLARE

2. CURSOR cur_emps

3. SELECT employee_id, last_name FROM employees;

Group of answer choices

Explicit Cursor

IMPLICIT CURSOR

Explicit Cursor

57
New cards

The given syntax in declaring a user-define record is incorrect.

TYPE type_name IS RECORD

(field_declaration[,field_declaration]...);

identifier type_name ;

Group of answer choices

True

False

False

58
New cards

The ___________ and ___________ are the two types of Oracle Server Errors.

Group of answer choices

Predefined, Non-predefined

Implicit, Explicit

Predefined, Non-predefined

59
New cards

In non-predefined exception, you must reference the ________ within a WHEN clause in the exception-handling section.

Group of answer choices

Oracle associated error#

Declared exception name

Exception name

All the options are possible

Declared exception name

60
New cards

The RAISE_APPLICATION_ERROR can be used in executable and exception section.

Group of answer choices

True

False

True

61
New cards

Each exception handler is consists of a _____ clause, which specifies an exception name.

Group of answer choices

WHEN

IF

Not in the options

CONDITION

WHEN

62
New cards

In exception section, the WHEN clause if followed by _______.

EXCEPTION NAME

63
New cards

There are 2 parameters needed in the pragma declaration of an exception.

Group of answer choices

True

False

True

64
New cards

Pragma declaration is used in declaring non-predefined exceptions.

Group of answer choices

True

False

True

65
New cards

The PRAGMA clause is used in predefined exception to tell the compiler to associate an exception name with a specific Oracle error number.

Group of answer choices

True

False

False

66
New cards

Names for predefined exceptions must be declared in the declaration section.

Group of answer choices

True

False

False

67
New cards

Given the code below, EMPLOYEES table must be specified at the DBMS_OUTPUT section.

DECLARE

v_emp_record employees2%rowtype;

BEGIN

SELECT * INTO v_emp_record FROM employees2 WHERE employee_id = 100;

DBMS_OUTPUT.PUT_LINE('Email for ' || _____________.first_name || ' ' || ____________.last_name);

END;

Group of answer choices

True

False

False

68
New cards

You must include the ________ clause in the cursor query so that the rows are locked on OPEN.

FOR UPDATE

69
New cards

The NOWAIT keyword is mandatory in the FOR UPDATE clause.

Group of answer choices

True

False

False

70
New cards

The %ROWTYPE cannot be used to declare a record based on another record.

Group of answer choices

True

False

False

71
New cards

Given the code below:

DECLARE

CURSOR cur_emps

SELECT employee_id, last_name FROM employees;

BEGIN

FOR cur_emps IN v_emp_record LOOP

EXIT WHEN cur_emps%ROWCOUNT > 5;

DBMS_OUTPUT.PUT_LINE(v_emp_record.employee_id || ' ' || v_emp_record.last_name);

END LOOP;

END;

Line 5 is valid or invalid?

Group of answer choices

Invalid

Valid

Invalid

72
New cards

Given the code below:

1. DECLARE

2. CURSOR cur_emps

3. SELECT employee_id, last_name FROM employees;

4. BEGIN

5. FOR v_emp_record IN cur_emps LOOP

6. EXIT WHEN cur_emps%ROWCOUNT > 5;

7. DBMS_OUTPUT.PUT_LINE(_____________.employee_id || ' ' || ___________.last_name);

8. END LOOP;

9. END;

What is missing in line#7?

Group of answer choices

V_EMP_RECORD

Cur_emps

V_EMP_RECORD

73
New cards

The ( ) symbol is used to enclose the elements of the TYPE structure.

Group of answer choices

True

False

True

74
New cards

If you omit the ______ keyword, then the Oracle server waits indefinitely until the rows are available.

NOWAIT

75
New cards

When we declare a cursor FOR UPDATE, each row is locked as we open the cursor but does not prevent other users from reading the rows.

Group of answer choices

True

False

True

76
New cards

The given code below declares an explicit cursor. What will cause an error in the code?

DECLARE

CURSOR cur_depts

SELECT * FROM departments WHERE location_id = 1700

ORDER BY department_name;

Group of answer choices

WHERE location_id = 1700

ORDER BY department_name;

SELECT *

IS

IS

77
New cards

The ______ returns character data containing the message associated with the error number.

Group of answer choices

SQLCODE

SQLERRM

SQLERRM

78
New cards

The _______________ is used in non-predefined exception to tell the compiler to associate an exception name with a specific Oracle error

Group of answer choices

PRAGMA EXCEPTION INIT

EXCEPTION INIT

PRAGMA EXCEPTION_INIT

EXCEPTION_INIT

PRAGMA EXCEPTION_INIT

79
New cards

The RAISE statement can be used to raise either user-defined or predefined exception.

Group of answer choices

True

False

False

80
New cards

The %ROWTYPE can be used to declare a record based on another record.

Group of answer choices

True

False

True

81
New cards

The oracle error number, at the PRAGMA EXCEPTION_INIT function, starts with _____.

Group of answer choices

0

1

UNDERSCORE

HYPEN

HYPEN

82
New cards

What is the first step in handing non-predefined exception?

Group of answer choices

Exception name declaration

Pragma declaration

Exception name declaration

83
New cards

The RAISE_APPLICATION_ERROR can be used in:

Group of answer choices

Executable and Exception section

Executable section

Exception section

Declaration and Exception section

Executable and Exception section

84
New cards

Given the code below:

DECLARE

CURSOR cur_emps

SELECT employee_id, last_name FROM employees;

BEGIN

FOR cur_emps IN v_emp_record LOOP

EXIT WHEN cur_emps%ROWCOUNT > 5;

DBMS_OUTPUT.PUT_LINE(v_emp_record.employee_id || ' ' || v_emp_record.last_name);

END LOOP;

END;

What will cause an error in the FOR section?

Group of answer choices

No error

Remove LOOP

Counter declaration

cur_emps IN v_emp_record

cur_emps IN v_emp_record

85
New cards

PL/SQL records contain one or more components/fields of any SCALAR or ______ type.

COMPOSITE

86
New cards

The __________ clause is used in conjunction with the FOR UPDATE clause to refer to the most recently fetched row in an explicit cursor.

WHERE CURRENT OF

87
New cards

Given the code below, EMPLOYEES%ROWTYPE is missing in the declaration section to declare v_emp_record as type record of EMPLOYEES table.

DECLARE

v_emp_record _______________;

Group of answer choices

True

False

True

88
New cards

PL/SQL records contain one or more components/fields of any scalar or composite type.

Group of answer choices

True

False

True

89
New cards

The declared non-predefined exception is raised ____________.

Group of answer choices

IMPLICITLY

EXPLICITLY

IMPLICITLY

90
New cards

The SQLCODE function returns the numeric value for the error code.

Group of answer choices

True

False

True

91
New cards

An exception handler for a particular exception must contain only one statement.

Group of answer choices

True

False

False

92
New cards

The __________ keyword is used in user-defined exception for error notification.

RAISE

93
New cards

The ___________ contains the exceptions handlers.

EXCEPTION SECTION

94
New cards

Handle named exceptions whenever possible, instead of using ______ in exception handlers.

OTHERS

95
New cards

Always add ________ whenever there is a possibility of an error occurring.

EXCEPTION HANDLER

96
New cards

The following statements are examples of ________________.

Entering an expiration date that has passed

Selecting more than one row into a single variable

Receiving "no rows returned" from a select statement

EXCEPTION

97
New cards

When code does not work as expected, PL/SQL raises an exception handler.

Group of answer choices

True

False

False

98
New cards

When an exception is raised, control immediately shifts to the exception section and the appropriate handler in the exception section is executed.

Group of answer choices

True

False

True

99
New cards

When an exception is raised, the rest of the execution section of the PL/SQL block is not executed.

Group of answer choices

True

False

True

100
New cards

The RAISE keyword is used by non-predefined exception.

Group of answer choices

True

False

False