Numeric Data Types
Complete numeric types reference: INT/BIGINT ranges, DECIMAL(M,D) precision/scale, FLOAT/DOUBLE storage sizes, and numeric type selection guidelines.
Last updated
Was this helpful?
Complete numeric types reference: INT/BIGINT ranges, DECIMAL(M,D) precision/scale, FLOAT/DOUBLE storage sizes, and numeric type selection guidelines.
General introduction to numeric data types. This page summarizes the available integer, fixed-point, and floating-point types and their storage characteristics.
Large integer type. A BIGINT uses 8 bytes and can store values from -9223372036854775808 to 9223372036854775807 (signed) or 0 to 18446744073709551615 (unsigned).
Bit-field data type. A BIT(M) column stores M bits per value, allowing storage of binary values from 1 to 64 bits in length.
Synonym for TINYINT(1). This type is commonly used to represent boolean values, where 0 is considered false and non-zero values are true.
Complete BOOLEAN type reference: TINYINT(1) synonym, TRUE/FALSE aliases, CREATE TABLE/SHOW CREATE TABLE output, and IF()/IS operator evaluation.
Synonyms for DECIMAL. These keywords declare fixed-point numbers, which store exact numeric data with a defined precision and scale.
Synonym for DECIMAL. This keyword creates a fixed-point column with exact precision, suitable for financial calculations.
Complete DECIMAL type reference: DECIMAL(M,D) syntax, precision limits (M≤65, D≤38), SIGNED/UNSIGNED/ZEROFILL options, and rounding behavior.
Synonym for DOUBLE. This keyword declares a normal-size (8-byte) floating-point number with double precision.
Double precision floating-point number. A DOUBLE column uses 8 bytes to store large or precise approximate values.
Synonym for DECIMAL. This keyword is used to define columns that require exact numeric precision, such as currency.
Single precision floating-point number. A FLOAT column uses 4 bytes and stores approximate values with less precision than DOUBLE.
Synonym for FLOAT. This keyword declares a single-precision floating-point column.
Synonym for DOUBLE. This keyword declares a double-precision floating-point column.
Explanation of floating-point precision issues. This page details why FLOAT and DOUBLE types are approximate and how rounding errors occur.
Complete INT type reference: INT(M) syntax, signed (-2147483648 to 2147483647) vs unsigned (0 to 4294967295) ranges, and ZEROFILL padding guidelines.
Synonym for TINYINT. This type uses 1 byte of storage.
Synonym for SMALLINT. This type uses 2 bytes of storage.
Synonym for MEDIUMINT. This type uses 3 bytes of storage.
Synonym for INT. This type uses 4 bytes of storage.
Synonym for BIGINT. This type uses 8 bytes of storage.
Synonym for INT. This keyword declares a standard 4-byte integer column.
Medium-sized integer. A MEDIUMINT column uses 3 bytes and stores values from -8388608 to 8388607 (signed) or 0 to 16777215 (unsigned).
Synonym for MEDIUMINT. This keyword refers to the 3-byte integer type.
Oracle-compatible synonym for DECIMAL. This type is used for fixed-point arithmetic.
Synonym for DECIMAL. This type stores exact numeric data values.
Synonym for DOUBLE. In standard SQL mode, REAL is a double-precision floating-point number.
Small integer type. A SMALLINT column uses 2 bytes and stores values from -32768 to 32767 (signed) or 0 to 65535 (unsigned).
Very small integer type. A TINYINT column uses 1 byte and stores values from -128 to 127 (signed) or 0 to 255 (unsigned).
This page is licensed: CC BY-SA / Gnu FDL
Last updated
Was this helpful?
Was this helpful?

