FORMATIVE 1 Flashcards
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
SQL%NOTFOUND
The DDL and DCL SQL statements cannot be used directly in PL/SQL.
True or False
True
The use of INTO clause in PL/SQL select statement is to specify the name of (VARIABLE).
True or False
True
The (SELECT) SQL Rule: queries must retunr only one row.
True or False
True
The (EXPLICIT) cursors are defined by the PL/SQL programmer
True or False
True
Which DML statement make changes to the database?
DELETE
INSERT
All the options
UPDATE
All of the options
The use of INTO clause in PL/SQL select statement is to specify the name of: ____________.
CURSOR
VARIABLE
TABLE
VIEW
VARIABLE
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
Cursor Attributes
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
SQL%NOTFOUND
Control structures are used to change the logical flow of statements within the PL/SQL block.
True or False
True
A counter variable is an expression that returns true, false, or null
True or False
False
The use of CASE statement to test conditions such as <, >, >=, <= is know as case expression.
True or False
False
Applying the logical operator NOT to a null yields FALSE.
True or False
False
Use the (BASIC) loop when the statement inside the loop must execute at least once.
True or False
True
Without the EXIT statement, the loop would never end (an infinite loop).
True or False
True
In BASIC and WHILE loop, the iteration will terminate when the counter is > than the upper bound.
True or False
False
The BASIC LOOP control structures are statements that enable you to execute statements in a PL/SQL block repeatedly.
True or False
True
The (SQL%ROWCOUNT) is an integer value that represents the number of rows affected by the most recent SQL statement.
True or False
True
The INTO clause occurs between the SELECT and (FROM) clauses
True or False
True
A _______ is an expression with a TRUE or FALSE value that is used to make a decision.
Condition
ELSE
Nested-if
Conditional statement
Condition
The _____ is the symbol used for the assignment operator.
=
:=
:=
An EXIT statement is used in order to come out of from the outer loop within a inner loop.
True
False
False
The lower and upper bound of a for loop must be a numeric literals.
True
False
False
The DML statement: INSERT, DELETE, (UPDATE) make changes to the database.
True
False
True
The (IMPLICIT) cursor are automatically defined by Oracle.
True
False
True
Which SQL statements cannot be used directly in PL/SQL?
DDL, DCL
DML
DML, TCL
TCL
DDL, DCL
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
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
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
Applying the logical operator NOT to a null yields NULL.
Group of answer choices
True
False
True
A condition is an expression that returns true, false, or null.
True
False
True
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
The type of loop where the statement inside the loop must execute at least once.
(BASIC LOOP)
True
False
True
In BASIC and WHILE loop, the iteration will terminate when the counter is < than the upper bound.
True
False
False
The BASIC LOOP control structures are statements that enable you to execute statements in a PL/SQL block repeatedly.
True
False
True
In BASIC and WHILE loop, initialization of counter variable is necessary.
True
False
True
The (MERGE) statement selects rows from one table to update and/or insert into another table.
True
False
True
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
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
The _____ statement selects rows from one table to update and/or insert into another table.
SELECT, INSERT, UPDATE
MERGE
DML
COMBINE
MERGE
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
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
Consider the given code fragment below. The condition will return a false value.
A:=null; B:=null;
If A = B then . . . . .
True
False
True
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
All counter variables must be declared at the declaration section.
True
False
False
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
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
The ______ is an expression that returns true, false, or null.
Counter variable
CONDITION
CASE STATEMENT
IF STATEMENT
IF STATEMENT
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
Use a DO.. WHILE loop when the statmeent inside the loop must execute at least once.
True
False
False
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
You can change the logical flow of statements within the PL/SQL block by using:
Subprograms
Control structures
Conditional statements
Looping statements
Control structures