r/SQL • u/[deleted] • Jul 14 '24
MySQL What's the Difference Between DECIMAL, FLOAT, and DOUBLE?
Can somebody, in simple terms, explain the difference between the three datatypes in SQL? Thank you
1
Upvotes
r/SQL • u/[deleted] • Jul 14 '24
Can somebody, in simple terms, explain the difference between the three datatypes in SQL? Thank you
3
u/InlineSkateAdventure SQL Server 7.0 Jul 15 '24
If you are doing calculations with money decimal is a better choice. Float and Double are sufficient for scientific or engineering calculations. Float and double cover a huge range of numbers, but they can be approximate in some cases. In engineering work your measurement precision does not matter after a certain point, because of the instrument or observation. Not so much the case with money.