1.

Which datatype is best suited to store currency values?(a) INT(b) FLOAT(c) DOUBLE(d) DECIMALThe question was asked during an online interview.The origin of the question is Choosing Data Types in division Data Types of MySQL

Answer»

Right OPTION is (d) DECIMAL

For EXPLANATION I WOULD say: Currency is a numeric information. For monetary calculations, FLOAT and DOUBLE are subject to rounding error and MAY not be suitable. A DECIMAL(M, 2) type is best suited for it.



Discussion

No Comment Found

Related InterviewSolutions