Académique Documents
Professionnel Documents
Culture Documents
After they
are Mark for Review
declared, (1) Points
variables
can be
used only
once in an
application.
True or
False?
True
False (*)
False
Correct
3. What characters must enclose non-numeric literal values?
Mark for Review
(1) Points
Parentheses: ()
Correct
4. Which of the following are valid identifiers? (Choose two.)
Mark for Review
(1) Points
(Choose all correct answers)
completion_%
students_street_address (*)
v_code (*)
Full Name
#hours
False
Correct
6. Which
of these Mark for Review
are (1) Points
PL/SQL
data
types?
(Choose
three.)
(Choose all correct answers)
Delimiter
Identifier
LOB (*)
Composite (*)
Scalar (*)
False
Correct
8. What symbol is used to comment a series of lines?
Mark for Review
(1) Points
/ / before and after the comment
The block will fail because the character value "Today" cannot be
implicitly converted to a date. (*)
Incorrect. Refer to Section 2 Lesson 5.
10. When you use a function to convert data types in a PL/SQL program, it is
called ______ conversion. Mark for Review
(1) Points
TO_CHAR
Explicit (*)
Implicit
Correct
Section 2 Quiz
(Answer all questions in this section)
11. The TO_CHAR function is used for explicit data type conversions. True or False?
Mark for Review
(1) Points
True (*)
False
False (*)
ChangChang
Chang (*)
Susan
False
Correct
15. 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 Mark for Review
of declaring the variable as: employees.salary%TYPE ? (1) Points
If the SALARY column is ALTERed later, the PL/SQL code need not be
changed. (*)
It executes much faster than using NUMBER(8,2)
It is shorter than coding NUMBER(8,2)
Section 2 Quiz
(Answer all questions in this section)
1. Which of the following is a valid naming convention for an identifier? (Choose two.)
Mark for Review
(1) Points
(Choose all correct answers)
Can include letters or numbers (*)
Correct
2. Valid identifiers begin with a _____.
Mark for Review
(1) Points
Number
Special character
Letter (*)
Correct
3. Which of the following makes PL/SQL code easier to read and maintain?
Mark for Review
(1) Points
Use suitable comments in the code. (*)
Susan
Chang (*)
ChangChang
Correct
Section 2 Quiz
(Answer all questions in this section)
6. What is wrong with this code?
Mark for Review
DECLARE (1) Points
v_a NUMBER;
BEGIN
v_a := 27;
<< inner_block >>
BEGIN
v_a := 15;
END;
The inner block has no END; statement. (*)
Variable v_a is out of scope within the inner block and therefore cannot be
referenced.
Nothing is wrong, the code will execute successfully.
False (*)
False
Correct
9. Examine the following variable declarations:
Mark for Review
DECLARE (1) Points
v_number NUMBER := 10;
v_result NUMBER;
v_result := ROUND(49.77);
v_result := v_number * 5;
Correct
10. A function called FORMAT_TODAYS_DATE accepts no parameters and returns
today's date in the format: Month DD, YYYY Mark for Review
(1) Points
The following anonymous block invokes the function:
DECLARE
v_today DATE;
BEGIN
-- invoke the function here
Which of the following statements correctly assigns the date variable v_today to
the value returned by the format_todays_date function?
format_todays_date := v_today('Month DD, YYYY');
v_today := format_todays_date(v_today);
Correct
12. Which of the following is a composite data type?
Mark for Review
(1) Points
CLOB
RECORD (*)
DATE
VARCHAR2
Correct
13. Examine the following code:
Mark for Review
1 DECLARE (1) Points
2 x NUMBER;
3 BEGIN
4 x:= '300';
5 END;
'300'
NULL
Correct
14. PL/SQL statements must be written on a single line.
Mark for Review
(1) Points
True
False (*)
False (*)
Correct