Why ENUM
suggest changeENUM stores one value from a short list of strings. MySQL keeps the list index, not a separate lookup table. A small set of non-numeric options works best. In non-strict mode an invalid value becomes ''. Strict SQL mode rejects it. Examples:
reply ENUM('yes', 'no')
gender ENUM('male', 'female', 'other', 'decline-to-state')
The values are strings:
INSERT ... VALUES ('yes', 'female')
SELECT ... --> yes female
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents