tinyint
Which is faster: char(1) or tinyint(1) ? Why?
Rate insert tinyint(1) insert char(1) insert enum(‘y’, ‘n’) insert tinyint(1) 207/s — -1% -20% insert char(1) 210/s 1% — -19% insert enum(‘y’, ‘n’) 259/s 25% 23% — Rate insert char(1) insert tinyint(1) insert enum(‘y’, ‘n’) insert char(1) 221/s — -1% -13% insert tinyint(1) 222/s 1% — -13% insert enum(‘y’, ‘n’) 254/s 15% 14% — Rate … Read more
MySQL Boolean “tinyint(1)” holds values up to 127?
The signed TINYINT data type can store integer values between -128 and 127. However, TINYINT(1) does not change the minimum or maximum value it can store. It just says to display only one digit when values of that type are printed as output.
BOOLEAN or TINYINT confusion
MySQL does not have internal boolean data type. It uses the smallest integer data type – TINYINT. The BOOLEAN and BOOL are equivalents of TINYINT(1), because they are synonyms. Try to create this table – CREATE TABLE table1 ( column1 BOOLEAN DEFAULT NULL ); Then run SHOW CREATE TABLE, you will get this output – … Read more
What is the difference between BIT and TINYINT in MySQL?
A TINYINT is an 8-bit integer value, a BIT field can store between 1 bit, BIT(1), and 64 bits, BIT(64). For a boolean values, BIT(1) is pretty common.