Advertisements
Advertisements
प्रश्न
Can you think of an attribute for which fixed length string is suitable?
लघु उत्तरीय
Advertisements
उत्तर
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.,IN,US) - PIN code –
CHAR(6)(when stored as a string) - Employee code –
CHAR(5)if every code has exactly 5 characters.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
