Char datatype is used to store character strings of fixed length.
Char datatype is used to store character strings of fixed length. Varchar datatype is used to store character strings of variable length. It uses static memory location. It uses dynamic memory location.
The primary distinction between Char and Varchar is that char only stores fixed-length character string data types, whereas varchar stores variable-length string data types with an upper maximum of length defined. The CHAR and VARCHAR data types are similar, but they are stored and retrieved in different ways. They also differ in terms of maximum length and whether or not trailing spaces are kept. The length of the CHAR and VARCHAR types indicates the maximum amount of characters that can be stored.
