ENUMs in MySQL
What are ENUMs used for in MySQL?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Priya LingeRank #785 · 2.9K reputationPosted Dec 7, 2011, 7:28 PM EST
1.Using Enum can restrict the number of values that can be allowed to go inside a table.
ENUM is used to limit the values that persist in the table.
2.Example :
A> ENUM for Colors ENUM('blue','yellow','green')
We can use an insert statement like Insert colors values ('red').
B>CREATE TABLE months (month ENUM 'January', 'February', 'March',);
INSERT months VALUES ('April');
Please check below link .
http://www.mysqlfaqs.net/mysql-faqs/Data-Types/What-are-ENUM-and-SET-Data-Types-in-MySQL
Hope this will help you.
Thanks.
Arjun PanwarRank #254 · 9.9K reputationPosted Dec 7, 2011, 8:05 PM EST