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# Matthom at 10/12/2004 8:27 pm cst
Thanks for the link and feedback. You're right, though. It's barely worth consideration. It's not going to affect anything drastically. Therefore, I am going with # Joshua Street at 10/13/2004 4:12 am cst
Because I'm lazy, and can't be bothered looking it up, is enum case sensitive, or could you have got away with using the column type you specified in the post for both upper- and lower-case characters? # Matthom at 10/13/2004 4:54 am cst
Josh, # kaolin fire at 7/17/2005 2:29 pm cst
Actually,
# Brice at 1/17/2008 9:12 am cst
Haha this is pretty late feedback. CHAR can be any character. Which include numbers, etc... |
Recent Comments
Recent Music Listens
|
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.