When entering sales data into a database, you record the total price of items sold. If an item is sold for $19.99, which data type would be most appropriate to use for accuracy?
The correct answer is 'Floating-point number' because this data type allows for the representation of non-integer numbers that include a decimal point. In our scenario, $19.99 cannot be accurately represented as an integer since it is not a whole number. Using an integer would result in loss of precision, as it would have to be rounded to either $19 or $20.
The other options are incorrect because 'Integer' does not allow for decimal precision, 'Boolean' is used for true/false values, and 'Character' is typically used for single letters or symbols, not numbers with decimals.
Learn More
AI Generated Content may display inaccurate information, always double-check anything important.
What is a floating-point number?
Why can’t I use an integer to represent prices?
What are the other common data types used in databases, and when should they be used?
This question's topic:
CompTIA Tech+ FC0-U71 /
IT Concepts and Terminology
Report Issue
Oh snap!
Loading...
Loading...
Join premium for unlimited access and more features
Monthly
$14.99/mo
billed monthly (cancel any time)
3 Month Pass
$34.99
One time purchase Does not auto-renew.
Save $10!
MOST POPULAR
Annual Pass
$59.99
One time purchase Does not auto-renew.
Save $120!
BEST DEAL
Lifetime Pass
$119.99
One time purchase Good for life.
Save $240!
What you get:
Unlimited Questions
Major Voucher Discounts
Advanced PBQs
Zero ads
Track scores
Report Cards
Free tier is limited to 20 questions and limited Performance-based Questions (PBQs) .