Oracle Database Administration I — Question 18
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. A table can have only one primary key but multiple foreign keys
- 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. 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
- E. 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
- F. Only the primary key can be defined at the column and table level
- G. Primary key and foreign key constraints can be defined at both the column and table level
Correct answer: A, D, E, G
Explanation
Option A is correct because a table can indeed have one primary key but multiple foreign keys. Option D is correct as it is possible for child rows to remain even if the parent row is deleted, depending on the constraint settings. Option E is true as foreign key constraints can be set to automatically delete child rows when the parent is removed. Option G is accurate since both primary and foreign key constraints can be defined at different levels. Options B, C, and F are incorrect due to their limitations on the number of keys and definitions.