Oracle
1Z0-873 · Question #39
Which of the following are effects of defining foreign keys in InnoDB tables without specifying either ON UPDATE or ON DELETE?
The correct answer is C. InnoDB will disallow any delete or update on the primary key on a parent record that may have. The ON UPDATE and ON DELETE parts are optional. If you omit them, InnoDB simply disallows attempts to update or delete Code values in the CountryParent table if there are CityChild records that refer to them.
MySQL Storage Engines
Question
Which of the following are effects of defining foreign keys in InnoDB tables without specifying either ON UPDATE or ON DELETE?
Options
- AInnoDB will disallow foreign keys without specifying either ON UPDATE or ON DELETE.
- BInnoDB will disallow any delete or update on the primary key regardless if there is a
- CInnoDB will disallow any delete or update on the primary key on a parent record that may have
- DInnoDB will allow both deletes and updates on the primary key on a parent record even if they
How the community answered
(30 responses)- A10% (3)
- B3% (1)
- C80% (24)
- D7% (2)
Explanation
The ON UPDATE and ON DELETE parts are optional. If you omit them, InnoDB simply disallows attempts to update or delete Code values in the CountryParent table if there are CityChild records that refer to them.
Topics
#foreign keys#InnoDB#referential integrity#ON DELETE/ON UPDATE
Community Discussion
No community discussion yet for this question.