Discussion
The basic data type char(n) is a _____ length character string and varchar(n) is _____ length character.
Answer: C
Correct answer: Fixed, variable
char(n) always occupies \( n \) characters: a shorter value is padded with trailing spaces to fill the width. varchar(n) stores only the characters actually supplied, up to a maximum of \( n \).
The trade is space against predictability. char wastes space on short values but has a fixed offset, which can make row access marginally faster; varchar stores just what is needed at the cost of a length prefix. The practical rule is char for genuinely fixed-width codes and varchar for anything that varies.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development