Database Fundamentals — Question 51
You need to store product names that vary from three to 30 characters. You also need to minimize the amount of storage space that is used.
Which data type should you use?
Answer options
- A. VARCHAR (3, 30)
- B. CHAR (3, 30)
- C. VARCHAR (30)
- D. CHAR (30)
Correct answer: C
Explanation
The correct answer is C, as VARCHAR (30) efficiently uses space by only allocating as much storage as the actual string length, up to 30 characters. Options A and B are incorrect because they specify a minimum length which can lead to wasted space, and option D uses CHAR, which also reserves a fixed amount of space regardless of actual string length.