What Is Decimal Data Type in Sql

To store numbers that have fixed precision and scale, you use the DECIMAL data type. … The precision has a range from 1 to 38. The default precision is 38. s is the scale which is the number of decimal digits that will be stored to the right of the decimal point.

What is decimal data type?

The decimal data type is an exact numeric data type defined by its precision (total number of digits) and scale (number of digits to the right of the decimal point).

Is decimal a valid data type in SQL?

The DECIMAL data type accepts numeric values, for which you may define a precision and a scale in the data type declaration. The precision is a positive integer that indicates the number of digits that the number will contain.

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest