An ENUM is a string object with a value chosen from a list of permitted values that are enumerated explicitly in the column specification at table creation time.
An enumeration value must be a quoted string literal; it may not be an expression, even one that evaluates to a string value. For example, you can create a table with an ENUM column like this:
mysql> create table car -> ( model_Number varchar(20), -> type ENUM('single','family','suv') -> ); Query OK, 0 rows affected (0.10 sec)
Inserting values into table :
mysql> insert into car values('ferrari12','single'); Query OK, 1 row affected (0.05 sec) mysql> insert into car values('endeavour','suv'); Query OK, 1 row affected (0.04 sec)
The above queries executed successfully because single and suv are enum values of the respected columns.
The insert statements for other values than enum will not be accepted.
mysql> insert into car values('endeavour','electric'); ERROR 1265 (01000): Data truncated for column 'type' at row 1