User Documentation
Ispirer Capabilities - MySQL Migration
Pricing
MySQL Data Types - BOOL
Versions: MySQL 5.x, 4.x and 3.23
| MySQL - BOOL | |
|---|---|
| Syntax | BOOL |
| Data | Boolean data |
| Range | -128 to 127 and NULL. Values TRUE and FALSE (MySQL keywords) are supported but converted to 1 and 0, respectively |
| Internals | Implemented as TINYINT SIGNED |
| Storage Size | 1 byte |
| Synonyms | BOOLEAN |
| Standards | MySQL Extension |
Example:
mysql>CREATE TABLE tab_bool (col1 BOOL, col2 BOOL); mysql>INSERT INTO tab_bool values (FALSE, TRUE); mysql>INSERT INTO tab_bool values (10, -20); mysql>SELECT * FROM tab_bool; +------+------+ | col1 | col2 | +------+------+ | 0 | 1 | | 10 | -20 | +------+------+
MySQL BOOL - Equivalents in Other Databases
| Database | Data Type and Conversion |
|---|---|
| SQL Server | BIT, 0 or 'false', 1 or 'true' and NULL |
| PostgreSQL | BOOLEAN, TRUE/FALSE (1/0) and NULL |
| Sybase ASE | BIT, 0 and 1, NULL is not allowed |
| Informix | BOOLEAN, 't', 'f' and NULL |
All Data Types