Question:

Which of the following ensures referential integrity in a relational database?

Show Hint

Think of integrity rules: Entity Integrity is enforced by Primary Keys (unique, not null). Referential Integrity is enforced by Foreign Keys (values must match a primary key in another table or be null).
Updated On: Jul 2, 2026
  • Primary Key
  • Foreign Key
  • Index
  • View
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

Let's define the concepts related to database integrity.
Referential Integrity is a property of data stating that all its references are valid. In a relational database, it means that if a foreign key in one table refers to a primary key in another table, then the referenced row must exist in the other table.
(A) Primary Key: A constraint that uniquely identifies each record in a table. It ensures entity integrity (no duplicate rows, no null values).
(B) Foreign Key: A key used to link two tables together. It is a field (or collection of fields) in one table that refers to the Primary Key in another table. The foreign key constraint is the mechanism that enforces referential integrity. It prevents actions that would leave orphan records (e.g., deleting a customer who still has orders in the orders table).
(C) Index: A data structure that improves the speed of data retrieval operations.
(D) View: A virtual table based on the result-set of an SQL statement.
Therefore, the Foreign Key is the concept that ensures referential integrity.
Was this answer helpful?
0
0