The datatype best suited to store currency values is . . . . . . . .
A. INT
B. FLOAT
C. DOUBLE
D. DECIMAL
Answer: Option D
Solution (By Examveda Team)
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**.
Related Questions on MySQL Miscellaneous
How is communication established with MySQL?
A. SQL
B. Network calls
C. A programming language like C++
D. APIs
Which type of database management system is MySQL?
A. Object-oriented
B. Hierarchical
C. Relational
D. Network
Join The Discussion