# Bit Data Types
__*BIT Data Type*__
+ Data Type:
  + `BIT` 
+ Bit value:
  + Column width (M): Number of bits per value
  + 1 to 64 bits
+ Examples:
  + 4 bits of storage: `status_column BIT (4) ` 
+ A literal value can be expressed as
  + `b'1101'` 
  + `0b1101` 	 

------------------------------------------------------------
For example:
```
mysql> create table test.tt (id bit(2));
Query OK, 0 rows affected (0.08 sec)

mysql> insert into test.tt values (b'0101010');
ERROR 1406 (22001): Data too long for column 'id' at row 1

mysql> insert into test.tt values (b'010');
Query OK, 1 row affected (0.02 sec)

mysql> select collation(id) from test.tt;
+---------------+
| collation(id) |
+---------------+
| binary |
+---------------+
1 row in set (0.00 sec)

mysql> select hex(id) from test.tt;
+---------+
| hex(id) |
+---------+
| 2 |
+---------+
1 row in set (0.00 sec)
```

- BIT type
  - The bit value type. M indicates the length of the bit. The value ranges from 1 to 64, and its default value is 1.