SERIAL DEFAULT VALUE
AUTO_INCREMENT
UNIQUE.
Warning
When you use subtraction between integer values where
one is of type UNSIGNED, the result is unsigned unless the
NO_UNSIGNED_SUBTRACTION
"Cast Functions and
•
BIT[(M)]
A bit-field type.
indicates the number of bits per value, from 1 to 64. The default is 1 if
M
This data type was added in MySQL 5.0.3 for MyISAM, and extended in 5.0.5 to MEMORY, InnoDB,
BDB, and NDBCLUSTER. Before 5.0.3,
•
TINYINT[(M)] [UNSIGNED] [ZEROFILL]
A very small integer. The signed range is
•
BOOL,
BOOLEAN
These types are synonyms for TINYINT(1). A value of zero is considered false. Nonzero values are
considered true:
mysql>
SELECT IF(0, 'true', 'false');
+------------------------+
| IF(0, 'true', 'false') |
+------------------------+
| false
+------------------------+
mysql>
SELECT IF(1, 'true', 'false');
+------------------------+
| IF(1, 'true', 'false') |
+------------------------+
| true
+------------------------+
mysql>
SELECT IF(2, 'true', 'false');
+------------------------+
| IF(2, 'true', 'false') |
+------------------------+
| true
+------------------------+
However, the values
mysql>
SELECT IF(0 = FALSE, 'true', 'false');
+--------------------------------+
| IF(0 = FALSE, 'true', 'false') |
+--------------------------------+
| true
+--------------------------------+
mysql>
SELECT IF(1 = TRUE, 'true', 'false');
+-------------------------------+
| IF(1 = TRUE, 'true', 'false') |
+-------------------------------+
| true
+-------------------------------+
mysql>
SELECT IF(2 = TRUE, 'true', 'false');
+-------------------------------+
| IF(2 = TRUE, 'true', 'false') |
+-------------------------------+
| false
Numeric Type Overview
in the definition of an integer column is an alias for
Operators".
is a synonym for TINYINT(1).
BIT
-128
|
|
|
and
are merely aliases for
TRUE
FALSE
|
|
|
826
[537]
SQL mode is enabled. See
to 127. The unsigned range is
and 0, respectively, as shown here:
1
NOT NULL
Section 12.10,
is omitted.
M
to 255.
0
Need help?
Do you have a question about the 5.0 and is the answer not in the manual?
Questions and answers