ExamVeda
Login
Home
This question belongs to MySQL MySQL Miscellaneous
MySQL Miscellaneous
?

The datatype best suited to store currency values is . . . . . . . .

Answer & Solution
Correct Answer: Option D
This question asks about the best way to store money (currency) in a MySQL database.
Here's why the answer is DECIMAL:
* INT (Integer): Stores whole numbers only. Not good for money because it can't represent cents or fractions.
* FLOAT (Floating Point): Stores numbers with decimals, but it's not precise enough for currency. Small errors can accumulate, leading to incorrect calculations.
* DOUBLE (Double Precision Float): Similar to FLOAT, but with more decimal places. Still not ideal for accurate financial calculations.
* DECIMAL: The best choice for currency! It stores numbers with a fixed number of decimal places, ensuring precise calculations for money.
Therefore, the correct answer is D: DECIMAL**.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.