DATABASE Flashcards

1
Q

The ______ is a Boolean attribute that evaluates to True if the most recent SQL statement returned at least one row.

A

SQL%FOUND

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

VARIABLES

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

A

NO ERROR

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

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

Which DML statement make changes to the database?

A

All the options (INSERT, UPDATE, DELETE)

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

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

A

MERGE

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

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

A

SQL%ROWCOUNT

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

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

A

EMBEDDED

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

A

Missing INTO clause

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

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

The ______ are automatically declared variables that allow you to evaluate what happened when a cursor was last used.

A

Cursor attributes

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

16
Q

Boolean attribute that evaluates to TRUE if the most recent SQL statement did not return even one row. A.

A

SQL%NOTFOUND

16
Q

An integer value that represents the number of rows affected by the most recent SQL.

A

SQL%ROWCOUNT

17
Q

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

A

VARIABLE

18
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

19
Q

Applying the logical operator NOT to a null yields NULL.

A

TRUE

20
Q

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

A

TRUE

21
Q

You can change the logical flow of statements within the PL/SQL block by using:

A

Control Structures

22
Q

The _______ are used to change the logical flow of statements within the PL/SQL block.

A

Control Structures

23
Q

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

A

Searched CASE statement

24
Q

A _______ is an expression with a TRUE or FALSE value that is used to make a decision.

A

Condition

25
Q

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

A

TRUE

26
Q
A
27
Q

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

A

CONDITION

28
Q

In for loop, counter must be explicitly declared.

A

FALSE

29
Q

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

A

FALSE

30
Q

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

A

BASIC LOOP

31
Q

Use a DO..WHILE loop when the statement inside the loop must execute at least once.

A

FALSE

32
Q

A loop structure must have an exit clause.

A

TRUE

33
Q

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

A

BASIC