166k views
4 votes
Which data type will most efficiently store a person's age in years?

a) FLOAT
b) DECIMAL
c) INTEGER
d) VARCHAR

1 Answer

3 votes

Final answer:

The most efficient data type for storing a person's age in years is INTEGER because ages are whole numbers and using INTEGER utilizes less space and allows for faster database operations.

Step-by-step explanation:

The most efficient data type to store a person's age in years would be c) INTEGER. Ages are whole numbers and do not require decimals or floating-point precision. Furthermore, storing ages as integers will consume less space and facilitate faster operations compared to using a FLOAT, DECIMAL, or VARCHAR data type. The VARCHAR data type, while capable of storing numeric characters, is less efficient as it is designed for strings and will use up more storage space. DECIMAL is used for precise fixed-point arithmetic which is not necessary for ages, and FLOAT is a floating-point data type used when more precision is needed for numbers that have fractions, which is again, not required for whole numbers like age.

User Khizar Ansari
by
7.5k points