`gender` enum('female','male','rather not say','alien') NOT NULL default 'rather not say',
这是使用枚举的正确方法吗?
最佳答案
是的。更多信息在这里 http://dev.mysql.com/doc/refman/5.0/en/enum.html
您使用 ENUM 占用的存储空间更少,并且比存储实际字符串快得多,因为 MySQL 在内部将每个选项表示为一个数字。 IE。女性 = 0,男性 = 1,等等。
关于MySQL Enum 正确使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5037735/