Beginner SQL
Q38 / 100

What is the difference between CHAR and VARCHAR data types?

Correct! Well done.

Incorrect.

The correct answer is B) CHAR is fixed-length (padded with spaces), while VARCHAR is variable-length, storing only the actual characters used

B

Correct Answer

CHAR is fixed-length (padded with spaces), while VARCHAR is variable-length, storing only the actual characters used

Explanation

CHAR(n) always occupies n characters of storage (padding shorter strings with spaces), while VARCHAR(n) stores only the actual string length up to n.

Progress
38/100