FORMATIVE 1 Flashcards

1
Q

The _____ is a Boolean attribute that evaluates to TRUE if the most recent SQL statement did not return even one row

SQL%FOUND

SQL&NOTFOUND

SQL%ROWCOUNT

A

SQL%NOTFOUND

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

The DDL and DCL SQL statements cannot be used directly in PL/SQL.

True or False

A

True

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

The use of INTO clause in PL/SQL select statement is to specify the name of (VARIABLE).

True or False

A

True

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

The (SELECT) SQL Rule: queries must retunr only one row.

True or False

A

True

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

The (EXPLICIT) cursors are defined by the PL/SQL programmer

True or False

A

True

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

Which DML statement make changes to the database?

DELETE

INSERT

All the options

UPDATE

A

All of the options

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

The use of INTO clause in PL/SQL select statement is to specify the name of: ____________.

CURSOR

VARIABLE

TABLE

VIEW

A

VARIABLE

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

The ______ are automatically declared variables that allow you to evaluate what happened when a cursor was last used.

Explicit attributes

Attributes

Implicit attributes

Cursor attributes

A

Cursor Attributes

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

Boolean attribute that evaluates to TRUE if the most recent SQL statement did not return even one row. A.

SQL%FOUND

SQL%ROWCOUNT

SQL%COUNT

SQL%NOTFOUND

A

SQL%NOTFOUND

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

Control structures are used to change the logical flow of statements within the PL/SQL block.

True or False

A

True

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

A counter variable is an expression that returns true, false, or null

True or False

A

False

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

The use of CASE statement to test conditions such as <, >, >=, <= is know as case expression.

True or False

A

False

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

Applying the logical operator NOT to a null yields FALSE.

True or False

A

False

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

Use the (BASIC) loop when the statement inside the loop must execute at least once.

True or False

A

True

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

Without the EXIT statement, the loop would never end (an infinite loop).

True or False

A

True

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

In BASIC and WHILE loop, the iteration will terminate when the counter is > than the upper bound.

True or False

A

False

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

The BASIC LOOP control structures are statements that enable you to execute statements in a PL/SQL block repeatedly.

True or False

A

True

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

The (SQL%ROWCOUNT) is an integer value that represents the number of rows affected by the most recent SQL statement.

True or False

A

True

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

The INTO clause occurs between the SELECT and (FROM) clauses

True or False

A

True

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

A _______ is an expression with a TRUE or FALSE value that is used to make a decision.

Condition

ELSE

Nested-if

Conditional statement

A

Condition

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

The _____ is the symbol used for the assignment operator.

=

:=

22
Q

An EXIT statement is used in order to come out of from the outer loop within a inner loop.

True

False

23
Q

The lower and upper bound of a for loop must be a numeric literals.

True

False

24
Q

The DML statement: INSERT, DELETE, (UPDATE) make changes to the database.

True

False

25
Q

The (IMPLICIT) cursor are automatically defined by Oracle.

True

False

26
Q

Which SQL statements cannot be used directly in PL/SQL?

DDL, DCL

DML

DML, TCL

TCL

27
Q

What could be the possible error of the given code below?

DECLARE

v_sal_increase employees.salary%TYPE = 800;

BEGIN

UPDATE copy_emp

SET salary = salary + v_sal_increase

WHERE job_id = ‘ST_CLERK’;

END;

SET section

WHERE section

Variable declaration

No error

A

Variable declaration

28
Q

The memory area allocated by Oracle server to store the SQL statement and the data that it uses in known as:
Group of answer choices

View

Implicit Cursor

Explicit Cursor

Cursor

29
Q

What could be the possible error of the given code below?

DECLARE

v_deptno employees.department_id%TYPE := 10;

BEGIN

DELETE FROM copy_emp

WHERE department_id = v_deptno;

END;

DELETE section

No error

Variable declaration

WHERE section

A

DELETE section

30
Q

Applying the logical operator NOT to a null yields NULL.
Group of answer choices

True

False

31
Q

A condition is an expression that returns true, false, or null.

True

False

32
Q

A (LOOP LABELS) is used in order to come out of from the outer loop within an inner loop.

True

False

Not Sure

33
Q

The type of loop where the statement inside the loop must execute at least once.

(BASIC LOOP)

True

False

34
Q

In BASIC and WHILE loop, the iteration will terminate when the counter is < than the upper bound.

True

False

35
Q

The BASIC LOOP control structures are statements that enable you to execute statements in a PL/SQL block repeatedly.

True

False

36
Q

In BASIC and WHILE loop, initialization of counter variable is necessary.

True

False

37
Q

The (MERGE) statement selects rows from one table to update and/or insert into another table.

True

False

38
Q

The memory area alloacted by Oracle server to the store the SQL statement and the data that i uses in known as (IMPLICIT CURSOR).

True

False

39
Q

What could be the possible error of the given code below?

DECLARE

v_sal_increase employees.salary%TYPE := 800;

BEGIN

UPDATE copy_emp

SET salary = salary + v_sal_increase

WHERE job_id = ‘ST_CLERK’;

END;

WHERE section

Variable declaration

No error

SET section

40
Q

The _____ statement selects rows from one table to update and/or insert into another table.

SELECT, INSERT, UPDATE

MERGE

DML

COMBINE

41
Q

The code below must print the number of rows deleted. What is missing in the given code to satisfy the output?

DECLARE

v_deptno copy_emp.department_id%TYPE := 50;

BEGIN

DELETE FROM copy_emp

WHERE _____________ = v_deptno;

DBMS_OUTPUT.PUT_LINE(SQL%ROWCOUNT || ‘ rows deleted.’);

END;

JOB_ID

DEPARTMENTS

JOBS

DEPARTMENT_ID

A

DEPARTMENT_ID

42
Q

What could be the possible error of the given code below?

DECLARE

v_deptno employees.department_id%TYPE := 10;

BEGIN

DELETE FROM copy_emp

WHERE department_id = v_deptno;

END;

Variable declaration

No error

WHERE section

DELETE section

A

WHERE section

43
Q

Consider the given code fragment below. The condition will return a false value.

  A:=null; B:=null;

If A = B then . . . . .

True

False

44
Q

Is there something missing in the given code?

DECLARE

 v_myage NUMBER := 31; 

BEGIN

IF v_myage < 11

DBMS_OUTPUT.PUT_LINE(‘I am a child’);

END IF;

END;

True

False

45
Q

All counter variables must be declared at the declaration section.

True

False

46
Q

The (SQL%FOUND) is a Boolean attribute that evaluates to True if the most recent SQL statement returned at least one row

True

False

47
Q

What could be the possible error of the given code below?

DECLARE

v_sum_sal NUMBER(10,2);

v_deptno NUMBER NOT NULL := 60;

BEGIN

SELECT SUM(salary) FROM employees WHERE department_id = v_deptno;

DBMS_OUTPUT.PUT_LINE(‘Dep #60 Salary Total: ‘ || v_sum_sal);

END;

Group of answer choices

Group function error

Missing INTO clause

Query returns more than 1 row

Variable error

A

Missing INTO clause

48
Q

The ______ is an expression that returns true, false, or null.

Counter variable

CONDITION

CASE STATEMENT

IF STATEMENT

A

IF STATEMENT

49
Q

The use of CASE statement to test conditions such as <, >, >=, <= is known as:

Search CASE statement

Equality CASE statement

Conditional CASE Expression

Non-equality CASE statement

A

Searched CASE statement

50
Q

Use a DO.. WHILE loop when the statmeent inside the loop must execute at least once.

True

False

51
Q

The code below must print the number of rows updated, what is the missing part of the code?

Declare

v_cal_increase employees.salary%type := 800;

begin

update copy_emp

set salary = salary + v_sal_increase

where job_id = ‘ST_CLERK’;

dbms_output.put_line(_____________ || ‘ rows updated.’);

end;

SQL%ROWCOUNT

SQL%FOUND

‘SQL%ROWCOUNT’

‘SQL%FOUND’

A

SQL%ROWCOUNT

52
Q

You can change the logical flow of statements within the PL/SQL block by using:

Subprograms

Control structures

Conditional statements

Looping statements

A

Control structures