SQL Dialects Reference/Data structure definition/Data types/Numeric types

This page includes comparison tables which can be big and complex.

While it's perfectly all right to view them in their complete state, it is recommended to install a comparison tables extension that would allow to select particular columns of interest for comparison.

SQL version Feature Standard
SQL:2011
DB2 Firebird Ingres Linter MSSQL MySQL MonetDB Oracle
Vers. 11.x
PostgreSQL SQLite Virtuoso
 ? Integer (1 byte) [1] N/A N/A tinyint
integer1
N/A tinyint (always unsigned) TINYINT TINYINT TINYINT "char" (including quotation marks) TINYINT N/A
 ? Integer (2 bytes) [1] SMALLINT SMALLINT smallint
integer2
SMALLINT smallint SMALLINT SMALLINT SMALLINT SMALLINT
INT2
SMALLINT SMALLINT
 ? Integer (3 bytes) [1] N/A N/A N/A N/A N/A MEDIUMINT N/A N/A N/A MEDIUMINT N/A
 ? Integer (4 bytes) [1] INTEGER INTEGER integer
integer4
INT
INTEGER
int INT INT INT
INTEGER
INT
INTEGER
INT4
INTEGER INT
INTEGER
 ? Integer (8 bytes) [1] BIGINT BIGINT bigint
integer8
BIGINT bigint BIGINT BIGINT NUMBER(19) BIGINT
INT8
BIGINT N/A
 ? Float (single precision, 4 bytes) [2] REAL FLOAT float4
real
float(23)
FLOAT
REAL
FLOAT(n), n≤24
real
float(24)
FLOAT REAL REAL REAL
FLOAT(24)
FLOAT
REAL
REAL
 ? Float (double precision, 8 bytes) [2] DOUBLE
FLOAT
DOUBLE PRECISION float
float8
double precision
float(53)
DOUBLE
DOUBLE PRECISION
FLOAT(n), n>24
float
float(53)
DOUBLE FLOAT
DOUBLE
FLOAT
DOUBLE PRECISION
DOUBLE PRECISION
FLOAT(53)
DOUBLE
DOUBLE PRECISION
FLOAT
 ? Fixed precision (p) and scale (s) number [1] DECIMAL(p, s)
NUMERIC(p, s)
DECIMAL(p, s)
NUMERIC(p, s)
DECIMAL(p, s)
NUMERIC(p, s)
DECIMAL(p, s)
DEC(p,s)
NUMERIC(p, s)
NUMBER(p,s)
decimal(p, s)
numeric(p, s)
DECIMAL(p, s)
NUMERIC(p, s)
DECIMAL(p, s)
NUMERIC(p, s)
DECIMAL(p, s)
NUMERIC(p, s)
DECIMAL(p, s)
NUMERIC(p, s)
NUMERIC(p, s) DECIMAL(p, s)
NUMERIC(p, s)
 ? Fixed precision p and s limits no limits p ≤ 31, 0 ≤ s ≤ p p ≤ 18, 0 ≤ s ≤ p p ≤ 31, 0 ≤ s ≤ p p ≤ 30, 0 ≤ s ≤ p, s ≤ 10, p-s ≤ 20 p ≤ 38, 0 ≤ s ≤ p p ≤ 65, 0 ≤ 30 ≤ s ≤ p p ≤ 19, 0 ≤ s ≤ p p ≤ 38, 0 ≤ s ≤ p p ≤ 1000, 0 ≤ s ≤ p None, numbers stored as strings
 ? UNSIGNED support No No No No No No Yes No Yes No No No
 ? Set display width in integer No No No No No No Yes No No No Yes No
  1. a b c d e f SMALLINT, INTEGER, INT, BIGINT, DECIMAL and NUMERIC. See: Wikibook SQL
  2. a b FLOAT, REAL, DOUBLE PRECISION. See: Wikibook SQL
Last modified on 17 March 2014, at 15:07