int64
The SQL type integer
(short: int
) is typically no shorter than a 32 big signed integer (-2147483647 to 2147483647).
CREATE TABLE table_name (
column_name_1 INTEGER
,
column_name_2 INT
)
Note that the SQL language has no unsigned
modifier (see: domain
, check
).
Integer
in other places: cast
target.
Restricting the value range (e.g. unsigned): domain
, check
SQL types for decimal numbers: numeric
, decimal
, decfloat
Numeric types with approximate arithmetic: float
, real
, double precision
Product specific integer types: tinyint
, mediumint
, int2
, int4
, int8
, int64
, unsigned
, signed
The type integer
and its abbreviation int
are defined in ISO/IEC 9075:2016-2 (E011-01, “INTEGER
and SMALLINT
data types (including all spellings)”) with an implementation defined precision.0 The corresponding data type of the C programming language is long
,1 which corresponds to the above mentioned value range.2
You can’t catch up on 20 years of SQL evolution in one day. Subscribe the newsletter via E-Mail, Twitter or RSS to gradually catch up and to keep modern-sql.com on your radar.
The essence of SQL tuning in 200 pages
Buy now!
(paperback and/or PDF)
Paperback also available at Amazon.com.
Markus offers SQL training and consulting for developers working at companies of all sizes.
Learn more »
ISO/IEC 9075:2016, Part 2, §6.1 <data type>, Syntax Rule 28
ISO/IEC 9075:2016, Part 2, §13.5 Data type correspondences
ISO/IEC 9899:2017, §5.2.4.2.1 Sizes of integer types <limits.h>