Beruflich Dokumente
Kultur Dokumente
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 1
(Answer all questions in this section)
3. PL/SQL can be used not only with an Oracle database, but also with any
True
False (*)
Correct
4. Every PL/SQL anonymous block must start with the keyword DECLARE. T
True
False (*)
Correct
5. Which lines of code will correctly display the message "The cat sat on th
Application Builder
SQL Workshop (*)
Utilities
Object Browser
Correct
7. Given below are the parts of a PL/SQL block:
1. END;
2. EXCEPTION
3. DECLARE
4. BEGIN
Arrange the parts in order.
2,1,4,3
3,4,2,1 (*)
3,2,4,1
4,3,2,1
Correct
8. Errors are handled in the Exception part of the PL/SQL block. True or Fals
True (*)
False
Correct
9. Which statements are optional in a PL/SQL block? (Choose two.)
True
False (*)
Correct
Page 1 of 5
Next
Summary
declarative
nondeclarative
procedural (*)
low level
Correct
12. Which of the following statements about PL/SQL and SQL is true?
Section 2
(Answer all questions in this section)
13. Which of the following are PL/SQL lexical units? (Choose two.)
identifiers
variables
symbols (*)
Correct
True
False (*)
Correct
17. Single row character functions are valid SQL functions in PL/SQL. True or
True (*)
False
Correct
18. Examine the following code. What is the final value of V_MYBOOL ?
DECLARE
v_mynumber NUMBER;
v_mybool BOOLEAN ;
BEGIN
v_mynumber := 6;
v_mybool := (v_mynumber BETWEEN 10 AND 20);
v_mybool := NOT (v_mybool);
END;
True (*)
False
Correct
19. The implicit data type conversion at Point A may not work correctly. Why
DECLARE
v_mydate DATE;
BEGIN
V_MYDATE := '29-Feb-2004'; -- Point A
END;
True
False (*)
Correct
Previous
Page 2 of 5
Next
Summary
myvar :=
23. If today's date is 14th June 2007, which statement will correctly convert
TO_CHAR(sysdate)
TO_DATE(sysdate)
TO_DATE(sysdate,'Month DD, YYYY')
TO_CHAR(sysdate, 'Month DD, YYYY') (*)
Correct
24. Which of the following is an example of using a case convention for good
Naming variables.
Using %Type.
Including comments in the code. (*)
26. To comment a single line of code, use two dashes after the comment. Tr
True
False (*)
Correct
27. You need to declare a variable to hold a value which has been read from
Correct
28. Which of the following can be assigned to a Boolean variable?
1. Null
2. False
3. True
4. 0
2 and 3
2, 3 and 4
1, 2 and 3 (*)
1, 2, 3 and 4
Correct
29. Which of the following should NOT be used as the name of a variable?
A table name.
A table column name. (*)
The database name.
Correct
30. When nested blocks are used, which blocks can or must be labeled?
Previous
Page 3 of 5
Next
Summary
HelloWorld
Hello World
World
BEGIN
DECLARE
x VARCHAR2(12) := 'Susan';
BEGIN
x := x || x;
END;
DBMS_OUTPUT.PUT_LINE(x);
END;
Susan
Chang (*)
ChangChang
SusanChang
The code will fail with an error
Correct
34. When an exception occurs within a PL/SQL block, the remaining stateme
True (*)
False
Correct
35. Which statement most closely describes "data type"?
Variables
Scalar data types
LOBs (*)
Correct
37. What is the data type of the variable V_DEPT_TABLE in the following dec
DECLARE
TYPE dept_table_type IS TABLE OF departments%ROWTYPE INDEX BY PL
Scalar
Composite (*)
LOB
Correct
38. When a variable is defined using the NOT NULL keywords, the variable m
True (*)
False
Correct
39. Evaluate the following declaration. Determine whether or not it is legal.
DECLARE
maxsalary NUMBER(7) = 5000;
Correct.
Not correct. (*)
Correct
40. Identify which of the following assignment statements are valid. (Choose
Correct
Previous
Next
Page 4 of 5
Summary
Correct.
Not correct. (*)
Correct
Section 3
(Answer all questions in this section)
42. Which of the following best describes a database transaction?
END;
What happens when the block of code finishes?
44. You declare an implicit cursor in the DECLARE section of a PL/SQL block.
True
False (*)
Correct
45. A PL/SQL block includes the following statement:
SELECT last_name INTO v_last_name
FROM employees
WHERE employee_id=100;
True
False (*)
Null
46. Assume there are 5 employees in Department 10. What happens when t
UPDATE employees
SET salary=salary*1.1;
47. Which one of these SQL statements can be directly included in a PL/SQL
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;
(*)
v_salary employees.salary%TYPE;
BEGIN
Which of the following is a correct use of the INTO clause?
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
50. A variable is declared as:
DECLARE
v_holdit employees.last_name%TYPE;
BEGIN ...
Which of the following is a correct use of the INTO clause?
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
Previous
Page 5 of 5
Summary