Numeric Data MySQL

Numeric data types for the management system MySQL databases

MySQL supports the following numeric data types for its columns

TINYINT

The numeric data type TINYINT allows numbers from -128 to 127.

Also be defined as UNSIGNED (unsigned), then the possible values start at 0 to 255.

You can define the maximum number of digits in parentheses (size).

SMALLINT

The numeric data type SMALLINT allows numbers from -32768 to 32767.

Also be defined as UNSIGNED (unsigned), then the possible values start at 0 to 65535.

You can define the maximum number of digits in parentheses

MEDIUMINT

The numeric data type MEDIUMINT allows numbers from -8388608 to 8388607.

Also be defined as UNSIGNED (unsigned), then the possible values start at 0 to 16777215.

You can define the maximum number of digits in parentheses

INT

The numeric data type INT allows numbers from -2147483648 to 2147483647.

Also be defined as UNSIGNED (unsigned), then the possible values start at 0 to 4294967295.

You can define the maximum number of digits in parentheses

BIGINT

The numeric data type BIGINT allows numbers from -9223372036854775808 to 9223372036854775807.

Also be defined as UNSIGNED (unsigned), then the possible values start at 0 to 18446744073709551615.

You can define the maximum number of digits in parentheses

FLOAT

The numeric data type FLOAT to store small decimal numbers (floating point).

When floating-point, their calculations are approximate. You can specify the maximum number of digits (size) and the number of decimal (decimal).

FLOAT (6.2) will have 4 digits and 2 decimal places, for example, 5467.67

DOUBLE

The DOUBLE data type numeric can store large decimal numbers (floating point).

When floating-point, their calculations are approximate. You can specify the maximum number of digits (size) and the number of decimal (decimal).

DOUBLE (5.1) will have 4 digits and 1 decimal digit, for example, 5467.1

DECIMAL

The DECIMAL data type numeric can store large fixed-point decimal numbers, therefore, such calculations are accurate DECIMAL.

You can specify the maximum number of digits (size) and the number of decimal (decimal). The maximum number of digits is 65.

For example DECIMAL (20.6) means you will have 14 digits and 4 decimal digits.