# MySQL Decimal Data Type

In MySQL, the `DECIMAL`

and `NUMERIC`

data types store exact, fixed-point values.
In MySQL, NUMERIC is implemented as a DECIMAL, so a NUMERIC and DECIMAL are the
same data type.
This data type is used when it is important to preserve the exact precision,
such as storing money data.

## Declaration

In a DECIMAL column declaration, the precision and scale can be specified.

```
DECIMAL(13,2)
```

This declaration declares a precision of 13 and a scale of 2. The precision represents the number of significant digits that are stored for values, and the scale represents the number of digits that can be stored following the decimal point.

This would allow for a range of -9,999,999,999,999.99 to -9,999,999,999,999.99.

### Syntax

The declaration syntax for a DECIMAL column is `DECIMAL(M,D)`

. The ranges
of values for the arguments are as follows:

From MySQL 5.7 Reference Manual: DECIMAL Data Type Characteristics:

M is the maximum number of digits (the precision). It has a range of 1 to 65. (

*default: 10*)D is the number of digits to the right of the decimal point (the scale). It has a range of 0 to 30 and must be no larger than M. (

*default: 0*)