nerdexam
Oracle

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…

Schema Design and Data Types

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)
  • A
    8% (3)
  • B
    80% (32)
  • C
    10% (4)
  • D
    3% (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

#CHAR#VARCHAR#fixed-length data#storage efficiency

Community Discussion

No community discussion yet for this question.

Full 1Z0-873 Practice