COLLATIONS

The COLLATIONS provides information about collations for each character set.

  1. USE INFORMATION_SCHEMA;
  2. SELECT * FROM COLLATIONS;

The output is as follows:

  1. +----------------+--------------------+------+------------+-------------+---------+
  2. | collation_name | character_set_name | id | is_default | is_compiled | sortlen |
  3. +----------------+--------------------+------+------------+-------------+---------+
  4. | utf8_bin | utf8 | 1 | Yes | Yes | 1 |
  5. +----------------+--------------------+------+------------+-------------+---------+

The table has these columns:

  • collation_name: the collation name.
  • character_set_name: the name of the character set.
  • id: the collation ID.
  • is_default: Whether this collation is the default collation of the character set it belongs to.
  • is_compiled: Whether the character set is compiled into the system.
  • sortlen: the minimum amount of memory required to sort strings expressed in the character set.