top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What are ENUMs used for in MySQL?

0 votes
285 views
What are ENUMs used for in MySQL?
posted Jun 24, 2014 by Karamjeet Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

0 votes

Use of ENUM takes less storage space and is much faster than if you stored the actual strings since MySQL internally represents each choice as a number. I.e. female = 0, male = 1, etc.

answer Jun 25, 2014 by Rajneesh
0 votes

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’);

answer Jun 25, 2014 by Mohit Sharma
...