Oracle Database SQL — Question 23
Which two are true about using constraints? (Choose two.)
Answer options
- A. NOT NULL can be specified at the column and at the table level.
- B. A table can have only one PRIMARY KEY and one FOREIGN KEY constraint.
- C. A FOREIGN KEY column in a child table and the referenced PRIMARY KEY column in the parent table must have the same names.
- D. PRIMARY KEY and FOREIGN KEY constraints can be specified at the column and at the table level.
- E. A table can have multiple PRIMARY KEY and multiple FOREIGN KEY constraints.
- F. A table can have only one PRIMARY KEY but may have multiple FOREIGN KEY constraints.
Correct answer: D, F
Explanation
The correct answers are D and F because PRIMARY KEY and FOREIGN KEY constraints can indeed be defined at both the column and table levels, and a table can have one PRIMARY KEY while allowing multiple FOREIGN KEY constraints. Options A, B, C, and E are incorrect as they misrepresent the rules surrounding constraints, such as the limitation on the number of PRIMARY KEY constraints and the naming requirements for foreign keys.