Suppose the domain set of an attribute consists of signed four digit numbers.…
1998
Suppose the domain set of an attribute consists of signed four digit numbers. What is the percentage rate of reduction in storage space of this attribute if it is stored as an integer rather than in character form?
- A.
80%
- B.
20%
- C.
60%
- D.
40%
Attempted by 32 students.
Show answer & explanation
Correct answer: C
A signed four-digit decimal value stored as characters needs one sign character and four digit characters. With one byte per character, the character form uses 5 bytes.
The domain from negative 9999 to positive 9999 fits in a 2-byte signed integer because a 16-bit signed integer covers negative 32768 to positive 32767.
So the storage saved is 5 bytes minus 2 bytes, which is 3 bytes. The percentage reduction is 3 out of 5 bytes, or 60 percent.
Therefore, the correct answer is 60 percent.