Informatics Practices

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

Relational Database

3 Likes

Answer

4, 20

Reason — FName 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.

Answered By

1 Like


Related Questions