nerdexam
Oracle

1Z0-873 · Question #116

When working with InnoDB, which of the following is true when trying to create foreign key references?

The correct answer is C. Both the parent & child columns must be indexed. E. InnoDB may create an index automatically. In a foreign key relationship, the referring column and the referenced column should have the same data type, and both must be indexed. (If the referring column has no index, InnoDB creates an index on it automatically.)

InnoDB Storage Engine

Question

When working with InnoDB, which of the following is true when trying to create foreign key references?

Options

  • AOnly the child column must be indexed.
  • BOnly the parent column must be indexed.
  • CBoth the parent & child columns must be indexed.
  • DInnoDB will not create an index automatically.
  • EInnoDB may create an index automatically.

How the community answered

(28 responses)
  • A
    7% (2)
  • B
    11% (3)
  • C
    79% (22)
  • D
    4% (1)

Explanation

In a foreign key relationship, the referring column and the referenced column should have the same data type, and both must be indexed. (If the referring column has no index, InnoDB creates an index on it automatically.)

Topics

#InnoDB#foreign key indexes#automatic indexing#parent-child columns

Community Discussion

No community discussion yet for this question.

Full 1Z0-873 Practice