MYSQL Numeric Data Types

This tutorial will help you to understand about "MYSQL Numeric Data Types".

Storage Required For Numeic Types

Data TypeStorage Required
TINY INT1 byte
SMALL INT2 bytes
MEDIUM INT3 bytes
INT INTEGER4 bytes
BIGINT8 bytes
FLOAT(p)4 bytes
DOUBLE[PRECISION], REAL8 bytes
DECIMAL(M,D), NUMERIC(M,D)Various see the below details
BIT(M)approximately(M+7)/ 8 bytes
Values for decimal, numeric,
  1. Storage for the integer and fractional parts of each value are determined separately.
  2. Each multiple of nine digits requires four bytes and "leftover" digits require some fraction of four bytes. The storage required for excess digits is given by the following table.
Leftover DigitsNumber Of Bytes
00
11
21
32
42
53
63
74
84

Integer Types

MYSQL supports INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT integer data types. The following table will give the details of mysql storage and range for each integer type
TypeStorageMinimum ValueMaximum Value
BytesSigned/UnsignedSigned/Unsigned
TINYINT1-128127
0255
SMALLINT2-3276832767
065535
MEDIUMINT3-83886088388607
016777215
INT/ INTEGER4-21474836482147483647
04294967295
BIGINT8-92233720368547758089223372036854775807
018446744073709551615