Which data type should you use?

You are developing a database that will contain price information. You need to store the
prices that include a fixed precision and a scale of six digits. Which data type should you
use?

You are developing a database that will contain price information. You need to store the
prices that include a fixed precision and a scale of six digits. Which data type should you
use?

A.
Float

B.
Money

C.
Smallmoney

D.
Numeric

Explanation:
Numeric is the only one in the list that can give a fixed precision and scale.
Reference:
http://msdn.microsoft.com/en-us/library/ms179882.aspx



Leave a Reply 4

Your email address will not be published. Required fields are marked *


Greg

Greg

I believe the correct answer is: [B. Money].

Digits are left of decimal while precision is right of decimal.

Fixed precision: money or smallmoney will provide [.####].
Scale of six digits: max six digit number is 999,999. If you “scale” this number (max scale possibility) by doing (999,999 * 999,999) you get 999,998,000,001 which exceeds the smallmoney limitations.

Would love to see additional feedback.

Greg

Greg

ignore the above – scale of 6 digits eliminates money and smallmoney. numeric is correct!

chicco

chicco

Scale of six digits is the key. Numeric is correct.

malsa001

malsa001

The maximum precision of Money datatype is 4. Therefore the correct answer is d.