Mysql 09-Nov-2016

difference between VARCHAR and CHAR?

CHAR

  1. Used to store character string value of fixed length.
  2. The maximum no. of characters the data type can hold is 255 characters.
  3. It's 50% faster than VARCHAR.
  4. Uses static memory allocation.

VARCHAR

  1. Used to store variable length alphanumeric data.
  2. The maximum this data type can hold is up to 4000 characters.
  3. It's slower than CHAR.
  4. Uses dynamic memory allocation.