MySQL 5.0.3 introduced true bit-field values. These take the same amount of space in the database as the number of bits in their definition. Let's say we have three pieces of information about each book, and each piece can only be true (1) or false (0):
We'll use a single BIT field to store these three pieces of information. Therefore, we add a field having a length of 3 (which means 3 bits) to the
To construct and subsequently interpret the values we store in this field, we have to think in binary, respecting the position of each bit within the field. ...