I have a few values that come in from a server that need to be stored in my database. I\'m not a MySQL expert, but I understand it well enough for basic input/output. Right
From MySQL:
The declaration syntax for a DECIMAL column is DECIMAL(M,D). The ranges of values for the arguments in MySQL 5.1 are as follows:
M is the maximum number of digits (the precision). It has a range of 1 to 65. (Older versions of MySQL permitted a range of 1 to 254.)
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.
Consider this number: 123456789.12345 here M
is 14
and D
is 5
then based on this principle you can set DECIMALS(M,D) for each column based on Their expected maximum values.