MEDIUMINT
Medium-sized integer. A MEDIUMINT column uses 3 bytes and stores values from -8388608 to 8388607 (signed) or 0 to 16777215 (unsigned).
Syntax
MEDIUMINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]Description
Examples
With strict_mode set
CREATE TABLE mediumints (a MEDIUMINT,b MEDIUMINT UNSIGNED,c MEDIUMINT ZEROFILL);
DESCRIBE mediumints;
+-------+--------------------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+--------------------------------+------+-----+---------+-------+
| a | mediumint(9) | YES | | NULL | |
| b | mediumint(8) unsigned | YES | | NULL | |
| c | mediumint(8) unsigned zerofill | YES | | NULL | |
+-------+--------------------------------+------+-----+---------+-------+SIGNED and UNSIGNED
Out of Range
MEDIUMINT ZEROFILL
See Also
Last updated
Was this helpful?

