📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

Numeric



Integer Data Types

NameAliasSizeMin ValueMax Value
TINYINTINT81 byte-128127
SMALLINTINT162 bytes-3276832767
INTINT324 bytes-21474836482147483647
BIGINTINT648 bytes-92233720368547758089223372036854775807

Floating-Point Data Types

NameSizeMin ValueMax Value
FLOAT4 bytes-3.40282347e+383.40282347e+38
DOUBLE8 bytes-1.7976931348623157E+3081.7976931348623157E+308

Functions

See Numeric Functions.

Examples

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, float FLOAT, double DOUBLE );
DESC test_numeric;

Result:

┌───────────────────────────────────────────────────────────────────┐ │ Field │ Type │ Null │ Default │ Extra │ ├───────────────────┼───────────────────┼────────┼─────────┼────────┤ │ tiny │ TINYINT │ YES │ NULL │ │ │ tiny_unsigned │ TINYINT UNSIGNED │ YES │ NULL │ │ │ smallint │ SMALLINT │ YES │ NULL │ │ │ smallint_unsigned │ SMALLINT UNSIGNED │ YES │ NULL │ │ │ int │ INT │ YES │ NULL │ │ │ int_unsigned │ INT UNSIGNED │ YES │ NULL │ │ │ bigint │ BIGINT │ YES │ NULL │ │ │ bigint_unsigned │ BIGINT UNSIGNED │ YES │ NULL │ │ │ float │ FLOAT │ YES │ NULL │ │ │ double │ DOUBLE │ YES │ NULL │ │ └───────────────────────────────────────────────────────────────────┘

Was this page helpful?