DECIMAL is a fixed-point SQL numeric type for values where every decimal place matters, especially prices and money. Its two parameters control the total digits and the digits after the decimal point. section 1.10 section 4.7
A product price
In DECIMAL(5,2), the 5 allows five digits in total and the 2 reserves two digits to the right of the decimal point. A product price such as 29.99 fits this definition. section 1.10
Choose DECIMAL or NUMERIC when accuracy is required. FLOAT and DOUBLE use finite precision and can introduce rounding errors, which is risky for currency conversions and other financial values. section 4.7
Read the two DECIMAL parameters this way:
- Precision is the total number of significant digits. section 4.7
- Scale is the number of digits stored to the right of the decimal point. section 1.10 section 4.7
- Use a fixed-point type when rounding could make a measurable difference. section 4.7




