English

Can you think of an attribute for which fixed length string is suitable?

Advertisements
Advertisements

Question

Can you think of an attribute for which fixed length string is suitable?

Short Answer
Advertisements

Solution

Yes. A fixed-length string (CHAR) is suitable for attributes where the number of characters is always the same.

Example: A Gender attribute can use CHAR(1) because it can store values such as M or F.

Other examples include:

  • Country code – CHAR(2) (e.g., INUS)
  • PIN code – CHAR(6) (when stored as a string)
  • Employee code – CHAR(5) if every code has exactly 5 characters.
shaalaa.com
  Is there an error in this question or solution?
Chapter 8: Introduction to Structured Query Language (SQL) - Intext Questions [Page 145]

APPEARS IN

NCERT Informatics Practices [English] Class 11
Chapter 8 Introduction to Structured Query Language (SQL)
Intext Questions | Q 3. | Page 145
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×