DOUBLE, formally defined in the SQL standard as DOUBLE PRECISION, is an approximate numeric data type that uses IEEE-754 64-bit floating-point representation. It can hold very large or very small numbers with roughly 15-17 decimal digits of precision and an exponent range of about 10^-308 to 10^308. Because it is approximate, values are rounded to the nearest representable binary fraction, which can introduce small errors in arithmetic and comparisons.Most vendors expose the type under slightly different names:- MySQL, MariaDB: DOUBLE, DOUBLE PRECISION (synonyms)- PostgreSQL: DOUBLE PRECISION- SQL Server: FLOAT(53) (53 signifies 53-bit binary precision)- Oracle: BINARY_DOUBLE- SQLite: REAL (an alias using 8-byte floats)Unlike exact types such as DECIMAL or NUMERIC, DOUBLE should not be used for money, accounting, or other situations where every fraction of a unit must be preserved. It shines in scientific computing, analytics, statistical calculations, machine-learning pipelines, and anywhere a large dynamic range is valued over absolute exactness.DOUBLE occupies 8 bytes on disk and in memory. Arithmetic operations are usually hardware-accelerated, producing fast calculations. Most dialects allow CAST or implicit conversion between DOUBLE and other numeric types, although down-casting can lose precision.
FLOAT, REAL, DECIMAL, NUMERIC, CAST, ROUND
SQL-92
Use DOUBLE for scientific, statistical, or ML workloads that need a vast numeric range and can tolerate rounding. Use DECIMAL for exact monetary or inventory counts.
Approximately 15-17 decimal digits. Beyond that range values are rounded.
Not exactly. FLOAT is a generic term that each vendor maps to a specific precision. In most systems, FLOAT without length defaults to the same 8-byte format as DOUBLE, but this is not guaranteed.
Compare with a tolerance (epsilon) instead of exact equality, e.g., WHERE ABS(a - b) < 1e-9;