CHAR is a fixed-length character data type where as VARCHAR is a variable-length character data type.
CHAR should be used for storing fixed length character strings. String values will be space/blank padded before stored on disk. If this type is used to store variable length strings, it will waste a lot of disk space.
Where to use:
You can use CHAR when the data entries in a column are expected to be the same size.
You can use VARCHAR when the data entries in a column are expected to vary considerably in size.
You can use VARCHAR when the data entries in a column are expected to vary considerably in size.
No comments:
Post a Comment