GATE / CS ARCHIVE

GATE CSE 1998 / QUESTION 2.20

Binary versus character storage

Database Management Systems · Indexing, Storage & Query Processing · Full GATE CSE 1998 paper

GATE 1998, Q2.20 2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Indexing, Storage & Query Processing

Question 2.20, GATE 1998: Signed four-digit values are stored as character strings or integers. Choose reduction 80%, 20%, 60%, 40%.
Tap to enlarge
Your answer
Answer & solution

Answer: C: 60% under 5-byte text and 16-bit integer conventions (no official key was published)

A sign plus four decimal characters uses 5 bytes with one byte per character. Values from−9999 to 9999 fit in a 16-bit signed integer, using 2 bytes. The saving is 5−2=3 bytes, or 3/5·100%=60%, C. This assumes a fixed sign character and no text terminator or length metadata. A 32-bit integer would save only 20% under the same text layout, while other encodings change the comparison. Therefore the supplied result depends on the conventional storage widths rather than the numeric domain alone.

Original paper, page 5