Q433
The datatype best suited to store currency values is . . . . . . . .
A.
INT
B.
FLOAT
C.
DOUBLE
D.
DECIMAL
AnswerAnswer: Option D
Solution
Answer: Option D
Solution:
This question is asking about the best way to store money in a MySQL database. Here's why the answer is DECIMAL:
* INT is for whole numbers only, not good for amounts with cents.
* FLOAT and DOUBLE are for numbers with decimals, but they can sometimes have rounding errors that are bad for financial calculations.
* DECIMAL is specifically designed for storing precise decimal numbers, making it perfect for currency values.
So the answer is D: DECIMAL