Skip to main content

Numeric

Integer Data Types

Basic Integer Numbers data types.

Data TypeSyntaxSize(Bytes)Min ValueMax Value
Int8TINYINT1-128127
UInt8TINYINT UNSIGNED10255
Int16SMALLINT2-3276832767
UInt16SMALLINT UNSIGNED2065535
Int32INT4-21474836482147483647
UInt32INT UNSIGNED404294967295
Int64BIGINT8-92233720368547758089223372036854775807
UInt64BIGINT UNSIGNED8018446744073709551615

Floating-Point Data Types

Basic Float32/Float64 data types.

Data TypeSyntaxSize(Bytes)Min ValueMax Value
Float32FLOAT4-3.40282347e+383.40282347e+38
Float64DOUBLE8-1.7976931348623157E+3081.7976931348623157E+308

Functions

See Numeric Functions.

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 |
+-------------------+--------+------+---------+