FA1 - Sheet1 (1) Flashcards

(54 cards)

1
Q

The ______ clause is used in DML statement to specify variable(s) that will hold the value(s) that SQL returns from the SELECT clause.

A

INTO

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

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

A

VARIABLE

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

The INTO clause occurs between the SELECT and _______ clauses.

A

FROM

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

The DML statement: INSERT, DELETE, ________ make changes to the database.

A

UPDATE

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

Which SQL statements cannot be used directly in PL/SQL?
Group of answer choices

DDL, DCL

DML

TCL

DML, TCL

A

DDL, DCL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
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;

Group of answer choices

WHERE section

Variable declaration

No error

SET section

A

No error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
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;

Group of answer choices

SET section

No error

WHERE section

Variable declaration

A

Variable declaration

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

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

A

Cursor

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

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

A

False

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

Applying the logical operator NOT to a null yields FALSE.

A

False

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

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

A

BASIC

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

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

True

False

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

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

A

t

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

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

A

SQL%NOTFOUND

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

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

A

DCL

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

The _______cursor are automatically defined by Oracle.

A

IMPLICIT

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

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

DECLARE

v_salary employees.salary%TYPE;

BEGIN

SELECT salary INTO v_salary

FROM employees;

DBMS_OUTPUT.PUT_LINE(‘ Salary is : ‘ || v_salary);

END;

A

Query returns more than 1 row

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

The _______ statement selects rows from one table to update and/or insert into another table.
Group of answer choices

DML

COMBINE

MERGE

SELECT, INSERT, UPDATE

A

MERGE

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

What is missing in the given code below?

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;

A

V_SALARY

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
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)

INTO v_sum_sal FROM employees WHERE department_id = v_deptno;

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

END;

A

No error

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

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

  A:=null; B:=null;

If A = B then . . . . .

A

t

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

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

True

False

23
Q

In for loop, counter must be explicitly declared.
Group of answer choices

True

False

24
Q

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

25
The INTO clause occurs between the _______ and FROM clauses.
SELECT
26
The memory area allocated by Oracle server to store the SQL statement and the data that it uses in known as __________.
IMPLICIT CURSOR
27
Which DML statement make changes to the database? Group of answer choices INSERT DELETE All the options UPDATE
All the options
28
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
29
The code below must print the number of rows updated. Which part of the code must be changed to satisfy the output? 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;
SQL%FOUND
30
Consider the given code fragment below. The condition will return a true value. A:=null; B:=null; If A = B then . . . . .
False
31
Applying the logical operator NOT to a null yields NULL. Group of answer choices True False
True
32
In for loop, counter variable is declared _______.
IMPLICITLY
33
Without the EXIT statement, the loop would never end (an infinite loop).
True
34
All counter variables must be declared at the declaration section. Group of answer choices True False
35
An EXIT statement is used in order to come out of from the outer loop within an inner loop. Group of answer choices True False
False
36
The _________ SQL Rule: queries must return only one row.
EMBEDDED
37
The _____ is an integer value that represents the number of rows affected by the most recent SQL statement.
SQL%ROWCOUNT
38
The _____ statement selects rows from one table to update and/or insert into another table.
MERGE
39
The ______ are automatically declared variables that allow you to evaluate what happened when a cursor was last used. Group of answer choices Explicit attributes Cursor attributes Attributes Implicit attributes
Cursor attributes
40
What could be the possible error of the given code below? 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; Group of answer choices VARIABLE ERROR Query returns more than 1 row TABLE ERROR NO ERROR
NO ERROR
41
A counter variable is an expression that returns true, false, or null. Group of answer choices True False
False
42
What is missing in the given WHILE loop syntax? ________ WHILE condition statement1; statement2; . . . END ;
LOOP
43
A loop structure must have an exit clause. Group of answer choices True False
True
44
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 Query returns more than 1 row Variable error Missing INTO clause
Missing INTO clause
45
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; Group of answer choices True False
True
46
A ________ is used in order to come out of from the outer loop within an inner loop.
LOOP LABELS
47
The lower and upper bound of a for loop must be a numeric literals. Group of answer choices True False
False
48
The _________ cursors are defined by the PL/SQL programmer.
EXPLICIT
49
What is the output of the given code below? DECLARE v_deptno copy_emp.department_id%TYPE := 50; BEGIN DELETE FROM copy_emp WHERE department_id = v_deptno; DBMS_OUTPUT.PUT_LINE(SQL%ROWCOUNT || ' rows deleted.'); END;
Print the number of rows deleted
50
Control structures are used to change the logical flow of statements within the PL/SQL block. Group of answer choices True False
True
51
Use the ______ loop when the statement inside the loop must execute at least once.
BASIC
52
The use of INTO clause in PL/SQL select statement is to specify the name of: ____________. Group of answer choices VARIABLE CURSOR TABLE VIEW
VARIABLE
53
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; Group of answer choices DEPARTMENT_ID DEPARTMENTS JOBS JOB_ID
DEPARTMENT_ID
54
Use a DO..WHILE loop when the statement inside the loop must execute at least once. Group of answer choices True False
False