F1 SQL
F1 SQL
dcl
The ______ clause is used in DML statement to specify variable(s) that will hold the
value(s) that SQL returns from the SELECT clause. INTO
The ______ are automatically declared variables that allow you to evaluate what
happened when a cursor was last used. CURSOR ATTRIBUTES
Which DML statement make changes to the database? ALL THE OPTIONS
The use of CASE statement to test conditions such as <, >, >=, <= is know as case
expression. TRUE
The _______ are used to change the logical flow of statements within the PL/SQL block.
CONTROL STRUCTURE
The type of loop where the statement inside the loop must execute at least once. BASIC
LOOP
A ________ is used in order to come out of from the outer loop within an inner loop.
LOOP LABELS
The BASIC LOOP control structures are statements that enable you to execute statements
in a PL/SQL block repeatedly. FALSE
In BASIC and WHILE loop, the iteration will terminate when the counter value meets the
upper bound value.
The ______ is a Boolean attribute that evaluates to True if the most recent SQL
statement returned at least one row. SQL%FOUND
The ______ is a Boolean attribute that evaluates to TRUE if the most recent SQL
statement did not return even one row. SQL%NOTFOUND
The DML statement: INSERT, DELETE, ________ make changes to the database. UPDATE
The code below must print the number of rows updated. Which part of the code must be
changed to satisfy the output? VARIABLE ERROR
Declare
v_sal_increase employees.salary%type := 800;
begin
update copy_emp
set salary = salary + v_sal_increase
where job_id = ‘ST_CLERK’;
dbms_output.put_line(SQL%FOUND || ‘ rows updated.’);
end;
The code below must print the number of rows deleted. What is missing in the given
code to satisfy the output? DEPARTMENT_ID
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;
The _______ statement selects rows from one table to update and/or insert into another
table. MERGE
Control structures are used to change the logical flow of statements within the PL/SQL
block. TRUE
The use of CASE statement to test conditions such as <, >, >=, <= is know as:
CONDITIONAL CASE EXPRESSION
A _______ is an expression with a TRUE or FALSE value that is used to make a decision.
CONDITION
Refer to M1S3-code reference#1, what is missing in the creation of the implicit cursor
inside the loop body? _______ SQL
The memory area allocated by Oracle server to store the SQL statement and the data
that it uses in known as: CURSOR
The lower and upper bound of a for loop must be a numeric literals. F
1. The _____ is an integer value that represents the number of rows affected by the
most recent SQL statement.SQL%ROWCOUNT
3. The INTO clause occurs between the SELECT and _______ clauses.FROM
4. The ______ is a Boolean attribute that evaluates to TRUE if the most recent SQL
statement did not return even one row.SQL%FOUND
5. The DML statement: INSERT, DELETE, ________ make changes to the database.UPDATE
Consider the given code fragment below. The condition will return a false value. FALSE
A:=null; B:=null;
If A = B then . . . . .
7. What could be the possible error of the given code below? No erroR
DECLARE
v_salary employees.salary%TYPE;
BEGIN
SELECT salary INTO v_salary
FROM employees where employee_id = 100;
DBMS_OUTPUT.PUT_LINE(' Salary is : ' || v_salary);
END;
8. The code below must print the number of rows updated. Which part of the code must
be changed to satisfy the output? SQL%FOUND
Declare
v_sal_increase employees.salary%type := 800;
begin
update copy_empset salary = salary + v_sal_increase
where job_id = ‘ST_CLERK’;
dbms_output.put_line(SQL%FOUND || ‘ rows updated.’);
end;
9. What could be the possible error of the given code below? Query returns more than 1
row
DECLARE
v_salary employees.salary%TYPE;
BEGIN
SELECT salary INTO v_salary
FROM employees;
DBMS_OUTPUT.PUT_LINE(' Salary is : ' || v_salary);
END;
10. An integer value that represents the number of rows affected by the most recent
SQL. represents the number of rows affected by SQL%ROWCOUNT
12. Refer to M1S2-code reference#3, the missing in the last case selection is v_aport
> 10000.F
13. Refer to M1S2-code reference#2, the missing part of the condition in (1) is
FALSE.F
14. The use of CASE statement to test conditions such as <, >, >=, <= is know as case
expression. T
15. Consider the given code fragment below. The condition will return a false value.
A:=null; B:=null;If A = B then . . . . .FALSE
16. A _______ is an expression with a TRUE or FALSE value that is used to make a
decision. CONDITION
17. 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;
17. Refer to M1S2-code reference#3, what is the missing element in the where clause?
(UPPER) UPPER
19. Refer to M1S2-code reference#2, what should be the condition in (3)?vpop =>
1000000000
20. The use of CASE statement to test conditions such as <, >, >=, <= is know
as:Searched CASE statement
21. Refer to M1S3-code reference#1, what should be the initial value of vctr?51
22. Refer to M1S3-code reference#1, what is missing in the creation of the implicit
cursor inside the loop body? _______ SQL
23. What is missing in the given WHILE loop syntax? ________HILE conditionstatement1;
statement2;. . .END ;LOOP
24. Refer to M1S3-code reference#1, what value must be stored in vctr inside the loop
body? ______________vctr+1
25. Refer to M1S3-code reference#1, what is missing in the creation of the implicit
cursor inside the loop body? _______SQL
26. Refer to M1S3-code reference #4, the ‘>’ is the missing operator in the EXIT
section.T
27. Refer to M1S3-code reference#2, the VLOC_ID is missing in the SELECT statement?F
(V_LOC_ID)
28. Without the EXIT statement, the loop would never end (an infinite loop).T
30. Refer to M1S3-code reference#1, the loop body will be performed 5 times.T
1. The use of INTO clause in PL/SQL select statement is to specify the name of
________.VARIABLES
2. The ______ are automatically declared variables that allow you to evaluate what
happened when a cursor was last used.CURSOR ATTRIBUTES
3. The ______ is a Boolean attribute that evaluates to TRUE if the most recent SQL
statement did not return even one row.SQL%NOTFOUND
4. The INTO clause occurs between the _______ and FROM clauses.SELECT
6. What could be the possible error of the given code below? QUERY RETURNS MORE THAN 1
ROW
DECLARE
v_salary employees.salary%TYPE;
BEGIN
SELECT salary INTO v_salary
FROM employees;DBMS_OUTPUT.PUT_LINE(' Salary is : ' || v_salary);
END;
8. What could be the possible error of the given code below? NO ERROR
DECLARE
v_sal_increase employees.salary%TYPE := 800;
BEGIN
UPDATE copy_empSET salary = salary + v_sal_increase
WHERE job_id = 'ST_CLERK';
END;
9. The code below must print the number of rows updated. Which part of the code must
be changed to satisfy the output? SQL%FOUND
Declare
v_sal_increase employees.salary%type := 800;
begin
update copy_empset salary = salary + v_sal_increase
where job_id = ‘ST_CLERK’;dbms_output.put_line(SQL%FOUND || ‘ rows updated.’);
end;
10. Which DML statement make changes to the database?Insert, delete, update
12. Applying the logical operator NOT to a null yields FALSE.False (null)
13. Refer to M1S2-code reference#3, the table name AIRPORT is missing in the creation
of the implicit cursor.F
14. Refer to M1S2-code reference#3, data type for vmesg variable must be CHAR.F
16. The _______ are used to change the logical flow of statements within the PL/SQL
block.Control Structures
17. A _______ is an expression with a TRUE or FALSE value that is used to make a
decision.Condition
18. Refer to M1S2-code reference#1, what is that last missing element?End if;
19. Refer to M1S2-code reference#1, what is the missing element in the select
statement? __________vpop
20. Refer to M1S2-code reference#3, what is missing in the given CASE structure?
Nothing is missing
21. Use the ______ loop when the statement inside the loop must execute at least
once.BASIC
22. Refer to M1S3-code reference #4, what is the missing operator in the EXIT section?
>
23. Refer to M1S3-code reference#1, what type of looping is used in the code?
________BASIC LOOP
25. Refer to M1S3-code reference#1, what should be the initial value of vctr?51
26. In BASIC and WHILE loop, the iteration will terminate when the counter is < than
the upper bound.F
29. Without the EXIT statement, the loop would never end (an infinite loop).T
1. The DDL and _______ SQL statements cannot be used directly in PL/SQL.DCL
2. The ______ clause is used in DML statement to specify variable(s) that will hold
the value(s) that SQL returns from the SELECT clause.INTO
3. The _________ SQL Rule: queries must return only one row IMPLICIT CURSOR
4. The _____ statement selects rows from one table to update and/or insert into
another table.MERGE
5. What could be the possible error of the given code below? VARIABLE DECLARATION
DECLARE
V_sal_increase employees.salary%TYPE = 800;
BEGIN
UPDATE copy_emp
SET salary = salary + v_sal_increaseWHERE job_id = 'ST_CLERK';
END;
8. Consider the given code fragment below. The condition will return a false value.
A:=null; B:=null;If A = B then . . . . .(F)
10. Refer to M1S2-code reference#3, the missing in the last case selection is v_aport
> 10000.T
11. Refer to M1S2-code reference#1, what is the missing element in the select
statement? __________Variable
12. The _______ are used to change the logical flow of statements within the PL/SQL
block.Control Structures
13. Refer to M1S2-code reference#3, what is missing in the last case selection?> 10000
15. Refer to M1S2-code reference#1, what is the correct condition that must be
supplied in the IF statement?vpop > 1000000000
17. Refer to M1S3-code reference#1, what is missing in the creation of the implicit
cursor inside the loop body? _______SQL%FOUND
18. Refer to M1S3-code reference#1, what value must be stored in vctr inside the loop
body? ______________VCTR+1
19. Refer to M1S3-code reference#1, what type of looping is used in the code?
________BASIC LOOP
20. Refer to M1S3-code reference#1, what should be the initial value of vctr? 51
21. In BASIC and WHILE loop, the iteration will terminate when the counter value meets
the upper bound value.
22. In BASIC and WHILE loop, the iteration will terminate when the counter value meets
the upper bound value.T
23. Refer to M1S3-code reference#1, the loop body will be performed 5 times.T
24. In BASIC and WHILE loop, the iteration will terminate when the counter is < than
the upper bound. F
F25. In BASIC and WHILE loop, the iteration will terminate when the counter is > than
the upper bound.T
The memory area allocated by Oracle server to store the SQL statement and the data
that it uses in known as __________.Cursor
The ______ is a Boolean attribute that evaluates to TRUE if the most recent SQL
statement did not return even one row.SQL%NOTFOUND
The ______ clause is used in DML statement to specify variable(s) that will hold the
value(s) that SQL returns from the SELECT clause.INTO
The ______ is a Boolean attribute that evaluates to True if the most recent SQL
statement returned at least one row.SQL%FOUND
The _______ statement selects rows from one table to update and/or insert into another
table.MERGE
1. What could be the possible error of the given code below? NO ERROR
DECLARE v_sum_sal NUMBER(10,2);v_deptno NUMBER NOT NULL := 60;
BEGIN
SELECT SUM(salary)INTO v_sum_sal
FROM employees WHERE department_id = v_deptno;DBMS_OUTPUT.PUT_LINE('Dep #60 Salary
Total: ' || v_sum_sal);
END;
4. The BASIC LOOP control structures are statements that enable you to execute
statements in a PL/SQL block repeatedly.T