The ENUM type is a string object that has only one value from a value list such as 'value1', 'value2', .... An ENUM value must be a string quoted in single quotation marks (').
ENUM values are internally expressed as integers. An ENUM column supports 65,535 different elements at most, but the actual limit may be less than 3,000. The ENUM type supports variable data length and the UTF8MB4 character set.
The syntax of ENUM is as follows:
ENUM('value1','value2',...) [CHARACTER SET charset_name] [COLLATE collation_name]
The CHARACTER SET attribute specifies the character set. If necessary, you can use COLLATE and other attributes to specify the collation of the character set.
The ENUM type has the following advantages:
The input strings are automatically encoded into numbers. This improves the compression ratio for data storage.
The queries and output are readable. The numbers are converted back into the corresponding strings in the query results.