Numeric Domains
The SQL standard prescribes two kinds of numeric domains: exact numeric data
types: numeric, decimal, integer and smallint, and approximate numeric
data types: float, double precision, and real. Their respective syntax is
Here, p stands for precision and s stands for scale (both of which are non-
negative integers). The precision parameter refers to the total number of digits,
while the scale indicates the number of digits to the right of the decimal point.
The difference between numeric and decimal is that in the latter case, p is
understood to be the maximum number of digits, while in the former case, p is
the exact total number of digits.
The domains smallint and integer have a number of digits dependent on
the implementation; however, the precision of integer is required to be equal
to or larger than the precision of smallint.
The float domain includes approximate representations of real numbers hav-
ing precision at least p. Also, real and double precision have implementation-
dependent precision, where the precision of double precision is never smaller
than the one of real.