Professional Documents
Culture Documents
Which lines of code will correctly display the message "The cat sat on
the mat"? (Choose two.) (1) Points
(Choose all correct answers)
2,1,4,3
3,4,2,1 (*)
3,2,4,1
4,3,2,1
Correct
Application Builder
Utilities
Object Browser
Correct
Executable
Exception
Declarative (*)
Definition
Correct
Oracle Jdeveloper
Oracle iSQL*Plus
Correct
Correct
True (*)
False
Correct
True
False (*)
PL/SQL is easier to learn and does not require an Oracle database or too
l
Correct
PL/SQL and SQL can be used with many types of databases, including Oracl
e.
PL/SQL allows basic program logic and control flow to be combined with S
QL statements. (*)
Correct
declarative
nondeclarative
procedural (*)
low level
Correct
True
False (*)
Correct
Section 2
13. Which of the following can be assigned to a Boolean var
iable?
1. Null
2. False
3. True
4. 0
(1) Points
2 and 3
2, 3 and 4
1, 2 and 3 (*)
1, 2, 3 and 4
Correct
v_count PLS_INTEGER:=0;
college_name VARCHAR2(20):='Harvard';
Correct
A table name.
Correct
16. Which of the following are valid assignment statements?
(Choose two.) (1) Points
(Choose all correct answers)
v_string = 'Hello';
v_string := Hello;
v_date := 28-DEC-06;
Correct
If Oracle changes the conversion rules in the future, your code may not
work any more (*)
Correct
True
False (*)
Incorrect. Refer to Section 2 Lesson 5.
Correct
Correct
21. Examine the following code:
1 DECLARE
2 x NUMBER;
3 BEGIN
4 x:= '300';
5 END;
After line 4, what is the value of x?
(1) Points
'300'
300 (*)
NULL
Correct
True
False (*)
Correct
Explicit (*)
Implicit
TO_CHAR
Correct
Correct
Naming variables.
Using %Type.
Correct
26. What good programming practice would make this code eas
ier to follow?
DECLARE
v_myvar VARCHAR2(20);
BEGIN
DECLARE
v_myvar VARCHAR2(15);
BEGIN
...
END;
END;
(1) Points
Correct
Correct.
Correct
True (*)
False
Correct
To comment code.
Correct
v_last_name := Chandra;
Correct
31. Examine the following code. Line A causes an exception. What will be di
splayed when the block is executed?
DECLARE
var_a NUMBER := 6;
var_b DATE;
BEGIN
var_a := var_a * 2;
var_b := '28 December 2006'; -- Line A
var_a := var_a * 2;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(var_a);
END;
(1) Points
12 (*)
24
Correct
8
12
20
VarB
Correct
My
My name (*)
My name is
My name is Zeynep
Correct
True (*)
False
Correct
35. When nested blocks are used, which blocks can or must b
e labeled? (1) Points
The inner block must be labeled, the outer block can be labeled.
Correct
yesterday (*)
yesterday's date
number_of_students_in_the_class
v$testresult (*)
#students
Correct
True
False (*)
Correct
identifiers
variables
symbols (*)
Correct
True (*)
False
Correct
Scalar (*)
Identifier
Delimiter
Composite (*)
LOB (*)
Correct
Variables
LOBs (*)
Correct
Section 3
42. A PL/SQL block includes the following statement:
SELECT last_name INTO v_last_name
FROM employees
WHERE employee_id=100;
What is the value of SQL%ISOPEN immediately after the SELECT statement is execut
ed?
(1) Points
True
False (*)
Null
Correct
A NULL is displayed.
An exception is raised because the block does not contain a COMMIT state
ment.
Correct
A DELETE statement
An UPDATE statement
Correct
Only one
Correct
SELECT *
INTO v_holdit
FROM employees;
SELECT last_name
INTO v_holdit
FROM employees;
SELECT last_name
INTO v_holdit
FROM employees
WHERE employee_id=100;
(*)
SELECT salary
INTO v_holdit
FROM employees
WHERE employee_id=100;
Correct
Specify the same number of variables in the INTO clause as database colu
mns in the SELECT clause.
Correct
SELECT salary
INTO v_result
FROM employees;
SELECT salary
INTO v_result
FROM employees
WHERE last_name ='Smith';
SELECT salary
INTO v_result
FROM employees
WHERE department_id = 80;
SELECT SUM(salary)
INTO v_result
FROM employees;
(*)
Correct
SELECT salary
INTO v_salary
FROM employees
WHERE employee_id=100;
(*)
SELECT v_salary
INTO salary
FROM employees
WHERE employee_id=100;
SELECT salary
FROM employees
INTO v_salary;
SELECT salary
FROM employees
WHERE employee_id=100
INTO v_salary;
Correct