0x60
0x60

Reputation: 1096

MySQL Enum correct use?

`gender` enum('female','male','rather not say','alien') NOT NULL default 'rather not say',

Is this the correct way to use enum?

Upvotes: 25

Views: 10409

Answers (1)

user479911
user479911

Reputation:

Yes it is. More info here http://dev.mysql.com/doc/refman/5.0/en/enum.html

Your 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.

Upvotes: 28

Related Questions