MySQL: enum or char(1)?
October 12, 2004
/ Filed under: SQL
In a recent table creation, in MySQL, I ran into a situation that could go one of two ways. The field I want to create will only contain a single letter. That letter is simply any letter of the alphabet. There are 26 letters total, and only one is chosen to be stored in that field. In MySQL, which column type should be used? An
Or... a
What do you think?
Comments/Mentions
|
Editor Picks
Email NewsletterSubscribe to the digest newsletter to receive posts by email: Recent Comments
Advertisements
|
You should read this (if you haven't already), mainly the comments.
http://dev.mysql.com/doc/mysql/en/ENUM.html
enum column type allows for a more strict set of input values, which could be good or bad.
Overall I don't think your choice should affect anything too much.