FA1 - Sheet1 (1) Flashcards

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

A

t

23
Q

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

True

False

A

False

24
Q

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

A

False

25
Q

The INTO clause occurs between the _______ and FROM clauses.

A

SELECT

26
Q

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

A

IMPLICIT CURSOR

27
Q

Which DML statement make changes to the database?
Group of answer choices

INSERT

DELETE

All the options

UPDATE

A

All the options

28
Q

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;

A

SQL%ROWCOUNT

29
Q

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;

A

SQL%FOUND

30
Q

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

A:=null; B:=null;

If A = B then . . . . .

A

False

31
Q

Applying the logical operator NOT to a null yields NULL.
Group of answer choices

True

False

A

True

32
Q

In for loop, counter variable is declared _______.

A

IMPLICITLY

33
Q

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

A

True

34
Q

All counter variables must be declared at the declaration section.
Group of answer choices

True

False

A
35
Q

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

A

False

36
Q

The _________ SQL Rule: queries must return only one row.

A

EMBEDDED

37
Q

The _____ is an integer value that represents the number of rows affected by the most recent SQL statement.

A

SQL%ROWCOUNT

38
Q

The _____ statement selects rows from one table to update and/or insert into another table.

A

MERGE

39
Q

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

A

Cursor attributes

40
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 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

A

NO ERROR

41
Q

A counter variable is an expression that returns true, false, or null.
Group of answer choices

True

False

A

False

42
Q

What is missing in the given WHILE loop syntax? ________

WHILE condition

statement1;

statement2;

. . .

END ;

A

LOOP

43
Q

A loop structure must have an exit clause.
Group of answer choices

True

False

A

True

44
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) 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

A

Missing INTO clause

45
Q

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

A

True

46
Q

A ________ is used in order to come out of from the outer loop within an inner loop.

A

LOOP LABELS

47
Q

The lower and upper bound of a for loop must be a numeric literals.
Group of answer choices

True

False

A

False

48
Q

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

A

EXPLICIT

49
Q

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;

A

Print the number of rows deleted

50
Q

Control structures are used to change the logical flow of statements within the PL/SQL block.
Group of answer choices

True

False

A

True

51
Q

Use the ______ loop when the statement inside the loop must execute at least once.

A

BASIC

52
Q

The use of INTO clause in PL/SQL select statement is to specify the name of: ____________.
Group of answer choices

VARIABLE

CURSOR

TABLE

VIEW

A

VARIABLE

53
Q

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

A

DEPARTMENT_ID

54
Q

Use a DO..WHILE loop when the statement inside the loop must execute at least once.
Group of answer choices

True

False

A

False