Home » Microsoft » MB6-886 » Which data type should you choose?
You need to design a table that will contain a monetary value. The value must support five digits to the right of the decimal point.
Which data type should you choose?
A. money
B. bigint
C. decimal
D. int
Correct Answer: C
Explanation/Reference:
bigint and int are integer data types, so they don’t support any decimal digits money accurate to a ten-thousandth of the monetary units that it represents So this type support only 4 decimal digits. decimal[ (p[ ,s] )] - Numeric data type that has fixed precision and scale. p (precision)
The maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point. The precision must be a value from 1 through the maximum precision of 38. The default precision is 18. s (scale)
The maximum number of decimal digits that can be stored to the right of the decimal point. Scale must be a value from 0 through p. Scale can be specified only if precision is specified. The default scale is 0; therefore, 0 <= s <= p. Maximum storage sizes vary, based on the precision.
So in the current scenario decimal(x,5) is the right way to go.