Skip to main content

Numeric Data Types

Integer Number

Basic Integer Numbers data types.

Data TypeSyntaxSizeMin ValueMax Value
Int8TINYINT1 byte-128127
UInt8TINYINT UNSIGNED1 byte0255
Int16SMALLINT2 byte-3276832767
UInt16SMALLINT UNSIGNED2 byte065535
Int32INT4 byte-21474836482147483647
UInt32INT UNSIGNED4 byte04294967295
Int64BIGINT8 byte-92233720368547758089223372036854775807
UInt64BIGINT UNSIGNED8 byte018446744073709551615

Floating Point Number

Basic Float32/Float64 data types.

Data TypeSyntaxSizeMin ValueMax Value
Float32FLOAT4 byte-3.40282347e+383.40282347e+38
Float64DOUBLE8 byte-1.7976931348623157E+3081.7976931348623157E+308

Examples

mysql> create table test_numeric(tiny tinyint, tiny_unsigned tinyint unsigned, smallint smallint, smallint_unsigned smallint unsigned, int int, int_unsigned int unsigned, bigint bigint, bigint_unsigned bigint unsigned);

mysql> desc test_numeric;
+-------------------+--------+------+---------+
| Field | Type | Null | Default |
+-------------------+--------+------+---------+
| tiny | Int8 | NO | 0 |
| tiny_unsigned | UInt8 | NO | 0 |
| smallint | Int16 | NO | 0 |
| smallint_unsigned | UInt16 | NO | 0 |
| int | Int32 | NO | 0 |
| int_unsigned | UInt32 | NO | 0 |
| bigint | Int64 | NO | 0 |
| bigint_unsigned | UInt64 | NO | 0 |
+-------------------+--------+------+---------+