What are ENUMs used for in MySQL?
Using Enum can restrict the number of values that can be allowed to go inside a table. If there is an ENUM for Colors ENUM(‘blue’,’yellow’,’green’) I can use an insert statement like Insert colors values (‘red’).
What are ENUMs used for in MySQL?
ENUM is used to limit the values that persist in the table. The following example illustrates the best use of ENUM.
CREATE TABLE months (month ENUM ‘January’, ‘February’, ‘March’,);
INSERT months VALUES (’April’);