TINYINT vs ENUM(0, 1) for boolean values in MySQL

Wiliam picture Wiliam · Aug 23, 2010 · Viewed 25.7k times · Source

Which one is better, Tinyint with 0 and 1 values or ENUM 0,1 in MyISAM tables and MySQL 5.1?

Answer

Adeel picture Adeel · Aug 23, 2010

You can use BIT(1) as mentioned in mysql 5.1 reference. i will not recommend enum or tinyint(1) as bit(1) needs only 1 bit for storing boolean value while tinyint(1) needs 8 bits.