- Accepts character strings (generously cast or not statically typed)
- Use
int64
The SQL type smallint
is typically no shorter than a 16 big signed integer (-32768 to 32767).
CREATE TABLE table_name (
column_name SMALLINT
)
Note that the SQL language has no unsigned
modifier (see: domain
, check
).
Related
Smallint
in other places:cast
target.Other integer types:
integer
/int
,bigint
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
Normative References
The type smallint
is defined in ISO/IEC 9075-2:2023 (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 short
,1 which corresponds to the above mentioned value range.2