i am studying the mysql certification guide. at the Bit Data Type section, it says
a BIT(4) sores 4 bit per value
and that storage requirement for a BIT(n) column is (n+7)/8. i dont understand this part. shldnt a BIT(4) take up just 4 bits of storage?
Actually it’s a clumsy way to round up the result. What it means is BIT(1) to BIT(8) take 1 byte, BIT(9) to BIT(16) take 2 bytes, etc… There is no 7 bits overhead. Divide the number of bits by 8 and round up the result. BIT(4) will take 1 byte.