1Z0-873 · Question #128
Suppose you have a column in which most records are going to be between 30 and 32 characters. Which of the following column types would be most efficient?
The correct answer is B. CHAR. If stored string values all have the same length, use a fixed-length type rather than a variable- length type. To store values that are always 32 characters long, CHAR(32) requires 32 characters each, whereas VARCHAR (32) requires 32 characters each, plus an extra byte to store…
Question
Suppose you have a column in which most records are going to be between 30 and 32 characters. Which of the following column types would be most efficient?
Options
- AVARCHAR
- BCHAR
- CTEXT
- DEither VARCHAR or CHAR
How the community answered
(40 responses)- A8% (3)
- B80% (32)
- C10% (4)
- D3% (1)
Explanation
If stored string values all have the same length, use a fixed-length type rather than a variable- length type. To store values that are always 32 characters long, CHAR(32) requires 32 characters each, whereas VARCHAR (32) requires 32 characters each, plus an extra byte to store the length. In this case, VARCHAR requires one byte more per value than CHAR.
Topics
Community Discussion
No community discussion yet for this question.