0% found this document useful (0 votes)
422 views

F1 SQL

1. The DDL and DCL SQL statements cannot be used directly in PL/SQL. The INTO clause is used in DML statements to specify variables that will hold values returned from a SELECT statement. Cursor attributes are automatically declared variables that allow you to evaluate what happened when a cursor was last used. 2. The DML statements INSERT, DELETE, and UPDATE make changes to the database. Control structures like loops are used to change the logical flow of statements within a PL/SQL block. 3. A basic loop ensures the statements inside the loop execute at least once. Implicit cursors are automatically defined by Oracle.

Uploaded by

oc dhogs Tv
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
422 views

F1 SQL

1. The DDL and DCL SQL statements cannot be used directly in PL/SQL. The INTO clause is used in DML statements to specify variables that will hold values returned from a SELECT statement. Cursor attributes are automatically declared variables that allow you to evaluate what happened when a cursor was last used. 2. The DML statements INSERT, DELETE, and UPDATE make changes to the database. Control structures like loops are used to change the logical flow of statements within a PL/SQL block. 3. A basic loop ensures the statements inside the loop execute at least once. Implicit cursors are automatically defined by Oracle.

Uploaded by

oc dhogs Tv
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

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

dcl

The _______cursor are automatically defined by Oracle. IMPLICIT

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

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

Applying the logical operator NOT to a null yields NULL. TRUE

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

What is missing in the given WHILE loop syntax? ________ LOOP


WHILE condition
statement1;
statement2;
. . .
END ;

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.

In for loop, counter must be explicitly declared. FALSE

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

In for loop, counter variable is declared _______. IMPLICITLY

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

2. The _________ cursors are defined by the PL/SQL programmer.EXPLICIT

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

6. 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;
No error

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

11. Applying the logical operator NOT to a null yields NULL.T

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

18. What is missing in the given code? NOT IN THE OPTION


DECLARE
v_myage NUMBER := 31;
BEGIN
IF v_myage < 11 DBMS_OUTPUT.PUT_LINE('I am a child');
END IF;
END;

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

29. In BASIC and WHILE loop, initialization of counter variable is necessary.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

5. The _______cursor are automatically defined by Oracle.IMPLICIT

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;

7. What is missing in the given code below? V_SALARY


DECLARE
v_salary employees.salary%TYPE; BEGIN
SELECT salary INTO ________FROM employees where employee_id =
100;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

11. Is there something missing in the given code? TRUE


DECLARE
v_myage NUMBER := 31; BEGIN
IF v_myage < 11 DBMS_OUTPUT.PUT_LINE('I am a child');
END IF;
END;

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

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


variable

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

24. In for loop, counter variable is declared _______.BEFORE THE 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

27. All counter variables must be declared at the declaration section.T


28. In BASIC and WHILE loop, the iteration will terminate when the counter value meets
the upper bound value.T

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

30. In for loop, counter must be explicitly declared.F(IMPLICITLY)

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;

6. 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;

7. Which SQL statements cannot be used directly in PL/SQL?Ddl, dcL

8. Consider the given code fragment below. The condition will return a false value.
A:=null; B:=null;If A = B then . . . . .(F)

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

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

14. The _______ is an expression that returns true, false, or null.CONDITION

15. Refer to M1S2-code reference#1, what is the correct condition that must be
supplied in the IF statement?vpop > 1000000000

16. In for loop, counter variable is declared _______.BEFORE THE LOOP

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

26. In for loop, counter must be explicitly declared. F

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;

2. Refer to M1S2-code reference#2, what is the missing condition in (2)?vpop = 0

3. Refer to M1S3-code reference#2, what is missing in the SELECT statement?V_LOC_ID

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

You might also like