3.1. Numeric Types
The SQL Standard has a wide range of numeric types. The idea is that any host language can find an SQL numeric type that matches one of its own.
You will also find some vendor extensions in the numeric data types, the most common of which is MONEY. This is really a DECIMAL or NUMERIC data type, which also accepts and displays currency symbols in input and output.
Numbers in SQL are classified as either exact or approximate. An exact numeric value has a precision, p, and a scale, s. The precision is a positive integer that determines the number of significant digits in a particular radix. The Standard says the radix can be either binary or decimal, so you need to know what your implementation does. The scale is a nonnegative ...
Get Joe Celko's SQL for Smarties, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.