Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2016

    Unanswered: What is the use of ENUMs in MySQL?

    Hello Everyone,

    Please tell me the usage of ENUMS in MYSQL?
    How it work and benefits of ENUMS?

  2. #2
    Join Date
    Dec 2012
    Hello evamaris,

    usage of ENUM in MySQL is:

    CREATE TABLE shirts (
        name VARCHAR(40),
        size ENUM('x-small', 'small', 'medium', 'large', 'x-large')
    INSERT INTO shirts (name, size) VALUES ('dress shirt','large'), ('t-shirt','medium'),
      ('polo shirt','small');
    SELECT name, size FROM shirts WHERE size = 'medium';
    | name    | size   |
    | t-shirt | medium |
    UPDATE shirts SET size = 'small' WHERE size = 'large';
    You can find complete documentation about ENUM at

    But in most cases you won't use ENUMs. Why?
    Please read the very good article about "why mysqls enum data type is evil":

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts