What is the difference between CHAR and VARCHAR data types?


Top Questions

Ans:

CHAR is a fixed length data type.

CHAR(n) will take n characters of storage even if you enter less than n characters to that column. For example, "answers" will be stored as "answers " in CHAR(10) column.

VARCHAR is a variable length data type.

VARCHAR(n) will take only the required storage for the actual number of characters entered to that column. For example, "answers" will be stored as "answers" in VARCHAR(10) column.

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
8 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Check It !

Tweet It

W3 Updates

Stay informed on our latest news!

Syndicate content