Explore Courses Blog Tutorials Interview Questions
0 votes
in SQL by (20.3k points)

What is the best SQL data type for currency values? I'm using MySQL but would prefer a database independent type.

1 Answer

0 votes
by (40.7k points)

You must use fixed-point numeric data type for storing the money values in MYSQL like this:


Here, 15 is the precision (i.e. total length of value including decimal places) and 2 is the number of digits after the decimal point.

Note: As money needs an exact representation. So, never use data-type that is only approximate like float. 

For more information, you can refer to MySQL Numeric Types

You can learn in-depth about SQL statements, queries and become proficient in SQL queries by enrolling in our industry-recognized SQL training.

Related questions

0 votes
1 answer
asked Dec 22, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.5k questions

32.6k answers


108k users

Browse Categories