Multiple choice

Suppose in the declaration section of a PL/SQL block, you create but do not initialize a NUMBER variable. What will be the initial value of the variable when the block is executed?

  1. 0

  2. NULL

  3. Depends on the scale and precision of the datatype.

  4. Without initialization, a variable cannot be used in the executable section of the block.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In PL/SQL, any scalar variable (NUMBER, VARCHAR2, DATE, etc.) that is declared but not initialized automatically gets NULL as its initial value. Option A is incorrect because 0 would need explicit initialization. Option C is wrong because NULL behavior is consistent across scale/precision. Option D is false because uninitialized variables can be used - they'll just be NULL until assigned.