Oracle Database SQL — Question 223
Which four statements are true regarding primary and foreign key constraints and the effect they can have on table data? (Choose four.)
Answer options
- A. Primary key and foreign key constraints can be defined at both the column and table level.
- B. A table can have only one primary key and one foreign key.
- C. The foreign key columns and parent table primary key columns must have the same names.
- D. A table can have only one primary key but multiple foreign keys.
- E. Only the primary key can be defined at the column and table level.
- F. It is possible for child rows that have a foreign key to remain in the child table at the time the parent row is deleted.
- G. It is possible for child rows that have a foreign key to be deleted automatically from the child table at the time the parent row is deleted.
Correct answer: A, D, F, G
Explanation
Option A is correct as both primary and foreign key constraints can indeed be defined at the column and table levels. Option D is also right because a table can have one primary key and multiple foreign keys. Options F and G are true regarding the behavior of child rows during the deletion of parent rows. Options B and C are incorrect as a table can have multiple foreign keys, and foreign key columns do not need to share names with the parent table's primary key columns.