Quiz 2
Quiz 2
(1) Points
2, 3 and 4
2 and 3
1, 2 and 3 (*)
1, 2, 3 and 4
Correct
2. Code is easier to read if you declare one identifier per line. True or False?
Mark for Review
(1) Points
True (*)
False
Correct
3. Single row character functions are valid SQL functions in PL/SQL. True or
False?
Mark for Review
(1) Points
True (*)
False
Correct
4. When PL/SQL converts data automatically from one data type to another,
it is called _______ conversion.
Mark for Review
(1) Points
Explicit
Implicit (*)
TO_CHAR
Correct
5. What will happen when the following code is executed?
DECLARE v_new_date DATE;
BEGIN
v_new_date := 'Today';
DBMS_OUTPUT.PUT_LINE(v_new_date);
END;
(1) Points
The block will fail because the character value "Today" cannot be implicitly
converted to a date. (*)
The block will execute and display today's date.
The block will execute and display the word "Today".
Correct
6. Reserved words can be used as identifiers. True or False?
Mark for Review
(1) Points
True
False (*)
Correct
(1) Points
True (*)
False
Correct
8. To comment a single line of code, use two dashes after the comment.
True or False?
Mark for Review
(1) Points
True
False (*)
Correct
9. What good programming practice would make this code easier to follow?
DECLARE
v_myvar VARCHAR2(20);
BEGIN
DECLARE
v_myvar VARCHAR2(15);
BEGIN
...
END;
END;
(1) Points
Using a consistent naming convention for variables
Developing a case convention for the code
Labeling the blocks (*)
Avoid using column names as identifiers
Correct
(1) Points
3,7
3,3
Null, 3
Null, 7 (*)
Correct
11. For the anonymous block below, what is the correct reference to the
father's date of birth in the inner block?
<< outer>>
DECLARE
v_father_name VARCHAR2(20):='Patrick';
v_date_of_birth DATE:='20-Apr-1972';
BEGIN
DECLARE
v_child_name VARCHAR2(20):='Mike';
v_date_of_birth DATE:='12-Dec-2002';
...
(1) Points
v_date_of_birth.outer
<< outer.v_date_of_birth >>
<< outer>>v_date_of_birth
outer.v_date_of_birth (*)
Correct
(1) Points
True (*)
False
Correct
(1) Points
True (*)
False
Correct
14. Which of the following is a composite data type?
Mark for Review
(1) Points
CLOB
RECORD (*)
VARCHAR2
DATE
Correct
(1) Points
True (*)
False
Correct
Previous