CBSE Class 11 Informatics Practices Question 39 of 87

Structured Query Language (SQL) — Question 20

Back to all questions
20
Question

Question 20

Consider a table Student having two fields—FName varchar(20) and LName char(20). If in a record, value stored in Fname is 'Anuj' and LName is 'Batra', then FName and LName will consume ...............and ............... Character space, respectively.

  1. 4, 5
  2. 4, 20
  3. 20, 4
  4. 20, 20
Answer

4, 20

ReasonFName is a varchar(20) field, which means it can store a variable-length string up to a maximum of 20 characters. Since the value stored in FName is 'Anuj', it will consume 4 character spaces (A-n-u-j). LName is a char(20) field, which means it is a fixed-length string that always occupies 20 character spaces, regardless of the actual length of the string. Since the value stored in LName is 'Batra', it will still consume 20 character spaces, with the remaining 15 characters being padded with spaces.