Can you think of an attribute for which fixed length string is suitable?
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
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
