In SQL, a number — i.e.: any signed, or unsigned, combination of the digits 0 to 9 — is either an exact numeric value or an approximate numeric value. A numeric value may be a <literal>, the value of a parameter or a host language variable or the result of any expression or argument (including a possibly qualified <Column name>) that evaluates to a number.
Exact numeric values have a precision and a scale. The precision is a positive integer that determines the number of significant digits in the radix. The scale is a non-negative integer that specifies the number of digits to the right of the value's decimal point. Exact numeric values are stored in one of the four exact numeric <data type>s: INTEGER , SMALLINT , NUMERIC or DECIMAL .
Approximate numeric values, or floating point numbers, have two parts: a signed decimal number (the mantissa) and a signed integer (the exponent). The exponent specifies the magnitude of the mantissa, so the value of such a number is the mantissa raised to the power of the exponent. Approximate numeric values also have a precision: a positive integer that specifies the number of significant bits in the mantissa. Approximate numeric values are stored in one of the three approximate numeric <data type>s: FLOAT , REAL or DOUBLE PRECISION .
-
Numbers
In SQL, a number -- i.e.: any signed, or unsigned, combination of the digit... -
Numeric <literal>s
A <numeric literal> is any number in one of two categories: the exact numer... -
Numeric <data type>s
A numeric <data type> is defined by a descriptor that contains four pieces ... -
IEEE Binary Floats
According to the IEEE Standard for Binary Floating-Point Arithmetic, "singl... -
Numeric Operations
A number is compatible with, and comparable to, all other numbers -- that i... -
Choosing the Right <data type>
When you're defining a <data type> specification, think about whether you r... -
Dialects
The "typical" SQL DBMS supports most of the standard numeric data types, bu... -
The SQL Library
Before we finish discussing numbers, it's time to add something to our "SQL...