Which of the following statements is true regarding a Foreign Key in a…
2023
Which of the following statements is true regarding a Foreign Key in a relational database?
- A.
A foreign key uniquely identifies every record in a table.
- B.
A foreign key is primarily used to sort records in ascending order.
- C.
A foreign key establishes a relationship between two tables using referenced values.
- D.
A foreign key must always contain only unique values.
- E.
A foreign key cannot contain duplicate or NULL values.
Attempted by 55 students.
Show answer & explanation
Correct answer: C
Concept
A foreign key is a column (or set of columns) in one table whose values must match the values of a candidate key (usually the primary key) in another — the referenced or parent — table. Its defining role is to enforce referential integrity: it ties rows in a child table to existing rows in a parent table, thereby modelling a relationship between the two tables.
Applying it here
The statement that a foreign key “establishes a relationship between two tables using referenced values” captures exactly this definition: the foreign-key column points at values that already exist in the referenced table, creating and constraining the link between the two relations. That is the purpose for which foreign keys exist.
Why the other statements fail
“Uniquely identifies every record” — that is the job of a primary key, not a foreign key; a foreign-key value commonly repeats across many child rows.
“Used to sort records in ascending order” — ordering is done with
ORDER BY(and assisted by indexes); a foreign key imposes no ordering on rows.“Must always contain only unique values” — uniqueness is a property of primary/unique keys; the same foreign-key value may appear in many rows (e.g. many orders referencing one customer).
“Cannot contain duplicate or NULL values” — a foreign key may both repeat and, unless declared
NOT NULL, hold NULL to represent “no related row.”
Result
A foreign key establishes a relationship between two tables using referenced values — it is the mechanism of referential integrity, not of identity, ordering, or uniqueness.