SQL Numbers
Whole numbers, exact decimals, and approximate decimals are genuinely different types — not just stylistic choices.
What & Why
Postgres separates numeric types by exactness, not just size. INTEGER holds whole numbers only. DECIMAL/NUMERIC holds exact fractional values — no rounding error, ever. REAL/DOUBLE PRECISION are approximate floating-point types, faster but capable of tiny rounding errors.
See How It Works
REFERENCE EXAMPLE
| Type | Holds | Use for |
|---|---|---|
| `INTEGER` | whole numbers | counts, IDs, ages |
| `DECIMAL(10,2)` | exact decimals, 2 places here | money — spend in our examples |
| `REAL` / `DOUBLE PRECISION` | approximate decimals | scientific measurements, never money |
The result uses the same Queryflo columns shown in the worked example.
Sign up free to try it on a real business scenario