Question 26Asked in UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)

An attribute A of data type varchar (20) has value 'Ram' and the attribute B of data type char (20) has value 'Sita' in oracle. The attribute A has ______…

An attribute A of data type varchar (20) has value 'Ram' and the attribute B of data type char (20) has value 'Sita' in oracle. The attribute A has ______ memory spaces and B has ______ memory spaces.
  1. A20, 20
  2. B3, 20
  3. C3, 4
  4. D20, 4
Show answerHide answer

Correct answer: (B) 3, 20

Explanation

CHAR and VARCHAR are both declared with a maximum length, but a CHAR column is fixed to the declared length (padded with spaces), while VARCHAR(20) uses only as much space as the stored value. So A ('Ram') needs 3 spaces and B ('Sita') needs 20.

From UGC NET Computer Science PYQ, June 2017 (Paper II & III, Selected Questions)

This is question 26 of UGC NET Computer Science PYQ, June 2017 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.