The ENUM Type Handling of Enumeration Literals Trailing spaces are automatically deleted from  ENUM  member values in the table definition when a table is created. When retrieved, values stored into an  ENUM  column are displayed using the lettercase that was used in the column definition. Note that  ENUM  columns can be assigned a character set and collation. For binary or case-sensitive collations, lettercase is taken into account when assigning values to the column. If you store a number into an  ENUM  column, the number is treated as the index into the possible values, and the value stored is the enumeration member with that index. (However, this does  not  work with  LOAD DATA , which treats all input as strings.) If the numeric value is quoted, it is still interpreted as an index if there is no matching string in the list of enumeration values. For these reasons, it is not advisable to define an  ENUM  column with enumeration values that look like numbers, because this can easily become confusing. For example, the following column has enumeration members with string values of  ’0’ ,  ’1’ , and  ’2’ , but numeric index values of  1 ,  2 , and  3 : If you store  2 , it is interpreted as an index value, and becomes  ’1’  (the value with index 2). If you store ’2’ , it matches an enumeration value, so it is stored as  ’2’ . If you store  ’3’ , it does not match any enumeration value, so it is treated as an index and becomes  ’2’  (the value with index 3). numbers ENUM(’0’,’1’,’2’) mysql>  INSERT INTO t (numbers) VALUES(2),(’2’),(’3’); mysql>  SELECT * FROM t; +---------+ | numbers | +---------+ | 1 | | 2 | | 2 | +---------+ To determine all possible values for an  ENUM  column, use  SHOW COLUMNS FROM  tbl_name  LIKE ’ enum_col ’  and parse the  ENUM  definition in the  Type  column of the output. In the C API,  ENUM  values are returned as strings. For information about using result set metadata to distinguish them from other strings, see C API Basic Data Structures. Empty or NULL Enumeration Values An enumeration value can also be the empty string ( ’’ ) or  NULL  under certain circumstances: •If you insert an invalid value into an  ENUM  (that is, a string not present in the list of permitted values), the empty string is inserted instead as a special error value. This string can be distinguished from a “normal” empty string by the fact that this string has the numeric value 0. See Index Values for Enumeration Literals for details about the numeric indexes for the enumeration values. •If an  ENUM  column is declared to permit  NULL , the  NULL  value is a valid value for the column, and the default value is  NULL . If an  ENUM  column is declared  NOT NULL , its default value is the first element of the list of permitted values. If strict SQL mode is enabled, attempts to insert invalid  ENUM  values result in an error. ENUM  values are sorted based on their index numbers, which depend on the order in which the enumeration members were listed in the column specification. For example,  ’b’  sorts before  ’a’  for 2045 Enumeration Sorting