Sometimes you have the task of storing multiple of boolean values
(yes/now or something similar) in the table and if you get many
columns and many rows you may want to store them as efficient way
as possible.
For MyISAM tables you could use BIT(1) fields
which get combined together for efficient storage:
PLAIN TEXT SQL:
- CREATE TABLE `bbool` (
- `b1` bit(1) NOT NULL,
- `b2` bit(1) NOT NULL,
- `b3` bit(1) NOT NULL,
- `b4` bit(1) NOT NULL,
- `b5` bit(1) NOT NULL,
- `b6` bit(1) NOT NULL,
- `b7` bit(1) NOT NULL,
- `b8` bit(1) NOT NULL,
- `b9` bit(1) NOT NULL,
- `b10` bit(1) NOT NULL
- ) ENGINE=MyISAM
- mysql> SHOW TABLE STATUS LIKE 'bbool' \G …