Please enlighten me...
Which data type consumes the smallest, TINYINT(1) or BIT(1)?
I know that TINYINT(1) and BIT(1) is considered the same according to majority of answers here.
Doesn't TINYINT(1) accepts 0-9 while BIT(1) can only 1 or 0. From the looks of it TINYINT uses larger storage because it can accept 2-9 while BIT only 1 and 0.
A TINYINT will always have a size of one (1) byte. And accept values between -128 and 127 (if signed).
The number you put in the brackets is for display purposes.
A BIT(1) on the other hand only take one bit in storage but needs to be aligned to whole bytes, meaning that if you only have one BIT(1) column, one byte is used, but if you have multiple they can be placed in the same byte.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With