The ENUM type is a string object that can have only one value, which must be one of the values in the list 'value1', 'value2', ... . The enum value must be a quoted string literal.
Internally, ENUM values are represented as integers. A single ENUM column can contain up to 65,535 distinct elements (the actual limit is less than 3,000). ENUM is a variable-length type that supports the UTF8MB4 character set.
The syntax for ENUM is as follows:
ENUM('value1','value2',...) [CHARACTER SET charset_name] [COLLATE collation_name]
You can use the CHARACTER SET clause to specify the character set. You can also use the COLLATE attribute and other attributes to specify the collation of the character set, if needed.
The ENUM type has the following advantages:
Strings are automatically encoded as numbers, which compresses data storage.
Queries and outputs are readable. Numbers are converted back to the corresponding strings in the query results.
