FLOAT and DOUBLE in SQL store approximate floating-point values, the same way the equivalent types do in C and Python. In MySQL, FLOAT uses 4 bytes (single precision, ~7 decimal digits of accuracy) and DOUBLE uses 8 bytes (double precision, ~15 decimal digits). They’re fast, cover an enormous dynamic range ( for single, for double), and lose precision in the last digit or two.

The naming isn’t fully portable. PostgreSQL has REAL (4 bytes, single) and DOUBLE PRECISION (8 bytes); writing FLOAT without a precision argument in PostgreSQL gives you double precision, not single. SQLite has a single REAL storage class that is always 8-byte IEEE 754. SQL Server has REAL (4 bytes) and FLOAT(n) where the precision n selects 4 or 8 bytes. Check the dialect before assuming what FLOAT means.

CREATE TABLE sensor_readings (
    reading_id   INT NOT NULL AUTO_INCREMENT,
    temperature  FLOAT,
    voltage      DOUBLE,
    PRIMARY KEY (reading_id)
);

These are the right types for scientific calculations and sensor readings — places where the loss of a few bits of precision doesn’t matter and the speed and range do. A temperature sensor reading at 23.4°C, a voltage at 1.27 V, a pH at 3.21 — all fine in FLOAT or DOUBLE.

They are not the right types for financial data, where rounding errors compound into wrong totals and money has to be exact. For that, use DECIMAL.

The IEEE 754 standard governs binary floating-point representation. A FLOAT is a 32-bit value: 1 sign bit, 8 exponent bits, 23 mantissa bits. A DOUBLE is 64 bits: 1 sign bit, 11 exponent bits, 52 mantissa bits. Because binary can’t exactly represent most decimal fractions, simple-looking arithmetic produces small surprises — 0.1 + 0.2 = 0.30000000000000004 is the canonical example. Comparing floats for equality is a common bug; the right pattern is abs(a - b) < epsilon for some small epsilon.

For most engineering data the precision is more than enough. For finance and accounting it isn’t. The choice of FLOAT vs DECIMAL is about which kind of error you can tolerate — small relative errors (FLOAT) or slower arithmetic (DECIMAL).