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
The (IMPLICIT) cursor are automatically defined by Oracle. True False
True
26
Which SQL statements cannot be used directly in PL/SQL? DDL, DCL DML DML, TCL TCL
DDL, DCL
27
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
Variable declaration
28
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
Cursor
29
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
DELETE section
30
Applying the logical operator NOT to a null yields NULL. Group of answer choices True False
True
31
A condition is an expression that returns true, false, or null. True False
True
32
A (LOOP LABELS) is used in order to come out of from the outer loop within an inner loop. True False Not Sure
Not Sure
33
The type of loop where the statement inside the loop must execute at least once. (BASIC LOOP) True False
True
34
In BASIC and WHILE loop, the iteration will terminate when the counter is < than the upper bound. True False
False
35
The BASIC LOOP control structures are statements that enable you to execute statements in a PL/SQL block repeatedly. True False
True
36
In BASIC and WHILE loop, initialization of counter variable is necessary. True False
True
37
The (MERGE) statement selects rows from one table to update and/or insert into another table. True False
True
38
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
True
39
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
No error
40
The _____ statement selects rows from one table to update and/or insert into another table. SELECT, INSERT, UPDATE MERGE DML COMBINE
MERGE
41
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
DEPARTMENT_ID
42
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
WHERE section
43
Consider the given code fragment below. The condition will return a false value. A:=null; B:=null; If A = B then . . . . . ------ True False
True
44
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
True
45
All counter variables must be declared at the declaration section. True False
False
46
The (SQL%FOUND) is a Boolean attribute that evaluates to True if the most recent SQL statement returned at least one row True False
True
47
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
Missing INTO clause
48
The ______ is an expression that returns true, false, or null. Counter variable CONDITION CASE STATEMENT IF STATEMENT
IF STATEMENT
49
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
Searched CASE statement
50
Use a DO.. WHILE loop when the statmeent inside the loop must execute at least once. True False
False
51
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’
SQL%ROWCOUNT
52
You can change the logical flow of statements within the PL/SQL block by using: Subprograms Control structures Conditional statements Looping statements
Control structures