Section 2 Quiz
(Answer all questions in this section)
1. When declared using %TYPE, a variable will inherit ____ from the
column on which it is based. Mark for Review
(1) Points
The value of the column
The data type and size of the column (*)
The name of the column
Correct Correct
2. You need to declare a variable to hold a value which has been
read from the SALARY column of the EMPLOYEES table. Which of the following is an
advantage of declaring the variable as: employees.salary%TYPE ? Mark for Review
(1) Points
It allows the software to perform implicit data type conversions.
It is shorter than coding NUMBER(8,2)
It executes much faster than using NUMBER(8,2)
If the SALARY column is ALTERed later, the PL/SQL code need not be changed.
(*)
Correct Correct
3. What symbol is used to comment a series of lines? Mark for
Review
(1) Points
/ / before and after the comment
* * before and after the comment
/* */ before and after the comment (*)
Correct Correct
4. Which of the following is an example of using a case convention
for good programming practice? Mark for Review
(1) Points
Include an exception handler in every PL/SQL block.
Declare data types in uppercase. (*)
Assign variables by using functions.
Declare variables in the DECLARE section.
Correct Correct
5. A movie is an example of which category of data type? Mark for
Review
(1) Points
Scalar
Composite
LOB (*)
Reference
Correct Correct
Section 2 Quiz
(Answer all questions in this section)
6. A datatype may specify a valid range of values. True or False?
Mark for Review
(1) Points
True (*)
False
Correct Correct
7. Variables may be reused. True or False? Mark for Review
(1) Points
True (*)
False
Correct Correct
8. Identify which of the following assignment statements are valid.
(Choose three.) Mark for Review
(1) Points
(Choose all correct answers)
v_music_type := 'ROCK'; (*)
v_blackout_date := '31-DEC-2006'; (*)
v_last_name := Chandra;
v_population := 333444; (*)
Correct Correct
9. PL/SQL can convert a VARCHAR2 value containing alphabetic
characters to a NUMBER value. True or False? Mark for Review
(1) Points
True
False (*)
Correct Correct
10. Using implicit conversions is good programming practice. Mark
for Review
(1) Points
True
False (*)
Correct Correct
Section 2 Quiz
(Answer all questions in this section)
11. TO_NUMBER, TO_CHAR, and TO_DATE are all examples of: Mark for
Review
(1) Points
Character functions
Implicit conversion functions
Operators
Explicit conversion functions (*)
Incorrect Incorrect. Refer to Section 2 Lesson 5.
12. Delimiters are _____ that have special meaning to the Oracle
database. Mark for Review
(1) Points
symbols (*)
identifiers
variables
Correct Correct
13. Which of the following symbols can be used to enclose a comment
in PL/SQL? Mark for Review
(1) Points
? ?
:: ::
*/ / *
/* */ (*)
Correct Correct
14. Examine the following code. At Line A, we want to assign a value
of 25 to the outer block's variable (V1). What must we do?
DECLARE
v_myvar NUMBER; -- This is V1
BEGIN
DECLARE
v_myvar NUMBER := 8;
BEGIN
-- Line A
END;
END;
Mark for Review
(1) Points
At Line A, code:
v_myvar := 25;
Label both blocks and at line A, code:
v_myvar := 25;
It cannot be done because the outer block's v_myvar is in scope but not
visible at Line A.
Label the outer block and (at Line A) dot-prefix v_myvar with the block
label.
(*)
It cannot be done because the outer block's v_myvar is out of scope at Line
A.
Correct Correct
15. A variable defined in an outer block is global to the outer block
and local to the inner block. True or False? Mark for Review
(1) Points
True
False (*)
Correct Correct