Section 2 (Quiz)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

SECTION 2 (QUIZ)

Section 2

1. Which of the following are scalar data types? (Choose three.)


Mark for Review

(1) Points
Table
Character (*)
Boolean (*)
Array
Date (*)
Correct

2. Which of the following are PL/SQL data types? (Choose three.)


Mark for Review

(1) Points
Large Objects (LOB) (*)
Composite (*)
Lexical
Scalar (*)
Delimiter
Correct

3. When a variable is defined using the NOT NULL keywords, the variable must contain a
value. True or False?
Mark for Review

(1) Points
True (*)
False
Correct

4. Is the following variable declaration correct or not?

DECLARE
display_qty CONSTANT NUMBER;

Mark for Review


(1) Points
Correct.
Not correct. (*)
Correct

5. Examine the following code. What is the scope of variable v_myvar?


DECLARE
v_myvar NUMBER;
BEGIN
v_myvar := 6;
DECLARE
v_hervar NUMBER;
BEGIN
v_hervar := 4;
END;
END;
Mark for Review

(1) Points
Both the inner and the outer block (*)
Only the outer block
Neither block
Only the inner block
Correct

6. If a variable definition is not found in an inner block where it is being referenced, where
does it look for it?
Mark for Review

(1) Points
This will result in an error.
It looks upward in the parent blocks. (*)
It downward in any other inner blocks.
Incorrect. Refer to Section 2 Lesson 6.

7. Delimiters are _____ that have special meaning to the Oracle database.
Mark for Review

(1) Points
variables
identifiers
symbols (*)
Correct

8. What is a lexical unit?


Mark for Review

(1) Points
A type of variable
A building block of a PL/SQL block (*)
A data type for a column
Correct

9. Which of the following statements about implicit conversions is NOT true?


Mark for Review

(1) Points
Code containing implicit conversions typically runs faster than code containing explicit
conversions. (*)
Code containing implicit conversions is harder to read and understand.
Code containing implicit conversions may not work in the future if Oracle changes the
conversion rules.
Correct

10. Which of the following is correct?


Mark for Review

(1) Points
v_family_name := SMITH;
v_family_name = SMITH;
V_FAMILY_NAME = SMITH;
v_family_name := 'SMITH'; (*)
Correct

11. 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?


Mark for Review

(1) Points
NULL
300 (*)
'300'
Correct

12. 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;

Mark for Review

(1) Points
Labeling the blocks (*)
Developing a case convention for the code
Using a consistent naming convention for variables
Avoid using column names as identifiers
Correct

13. 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

14. A variable must have a value if NOT NULL is specified. True or False?
Mark for Review

(1) Points
True (*)
False
Correct

15. When declared using %TYPE, a variable will inherit ____ from the column on which it is
based.
Mark for Review

(1) Points
The name of the column
The data type and size of the column (*)
The value of the column
Correct

You might also like