Which data type stores variable-length character values?

Study for the SQL Basics Test. Practice with flashcards and multiple choice questions, each with hints and explanations. Prepare for success!

Multiple Choice

Which data type stores variable-length character values?

Explanation:
Storing variable-length text is done with VARCHAR. It stores only as many characters as the actual value contains, up to a defined maximum, so strings of different lengths don’t waste space. CHAR, by contrast, uses a fixed length and pads shorter values to that length, which can waste space. Binary is for raw binary data, not text, and Date is for date values, not strings. Therefore, the data type best suited for variable-length character values is VARCHAR.

Storing variable-length text is done with VARCHAR. It stores only as many characters as the actual value contains, up to a defined maximum, so strings of different lengths don’t waste space. CHAR, by contrast, uses a fixed length and pads shorter values to that length, which can waste space. Binary is for raw binary data, not text, and Date is for date values, not strings. Therefore, the data type best suited for variable-length character values is VARCHAR.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy