Oracle
1Z0-873 · Question #115
When working with InnoDB, which of the following are true of a parent / child foreign key relationship?
The correct answer is B. The parent & child must have the same data type. 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 are true of a parent / child foreign key relationship?
Options
- AThe parent & child can have separate data types.
- BThe parent & child must have the same data type.
- CThe parent & child may sometimes need the same data type, but not always.
How the community answered
(26 responses)- A15% (4)
- B73% (19)
- C12% (3)
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 data types#referential integrity#parent-child
Community Discussion
No community discussion yet for this question.