DS0-001 · Question #75
Which of the following constraints is used to enforce referential integrity?
The correct answer is B. Foreign key. A foreign key enforces referential integrity by linking a column in one table to the primary key of another table, ensuring that a value in the child table must exist in the parent table - preventing orphaned records. A (Surrogate key) is not a constraint type at all; it's a…
Question
Which of the following constraints is used to enforce referential integrity?
Options
- ASurrogate key
- BForeign key
- CUnique key
- DPrimary key
How the community answered
(30 responses)- A3% (1)
- B87% (26)
- C7% (2)
- D3% (1)
Explanation
A foreign key enforces referential integrity by linking a column in one table to the primary key of another table, ensuring that a value in the child table must exist in the parent table - preventing orphaned records.
- A (Surrogate key) is not a constraint type at all; it's a synthetic identifier (like an auto-incremented ID) used as a primary key, with no referential role.
- C (Unique key) ensures no duplicate values in a column but says nothing about relationships between tables.
- D (Primary key) uniquely identifies rows within its own table but does not enforce relationships to other tables - that's the foreign key's job.
Memory tip: Think "foreign = from another country." A foreign key points outward to another table, so it's the one that enforces the relationship (integrity) between tables.
Topics
Community Discussion
No community discussion yet for this question.