Difficulty: Easy
Correct Answer: CHAR
Explanation:
Introduction / Context:
Choosing between CHAR and VARCHAR2 in Oracle depends on whether the text length is fixed or variable. Fixed-length codes (e.g., country_code, status_code) benefit from CHAR for simpler semantics and potential storage/CPU advantages at small sizes.
Given Data / Assumptions:
Concept / Approach:
Use CHAR(n) for fixed-length fields; Oracle pads to length n for storage/comparison semantics. VARCHAR2(n) is best for variable-length fields. LONG is obsolete and discouraged; CLOB is for large character data; NUMBER is numeric storage only.
Step-by-Step Solution:
Verification / Alternative check:
Oracle documentation advises VARCHAR2 for variable-length character strings and CHAR for fixed-length semantics, with LONG retained only for backward compatibility.
Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
CHAR.
Discussion & Comments