Which of the following key constraints ensures that a column value in one…

2025

Which of the following key constraints ensures that a column value in one table must match a value in another table?

  1. A.

    Primary Key

  2. B.

    Composite Key

  3. C.

    Foreign Key

  4. D.

    Unique Key

Attempted by 171 students.

Show answer & explanation

Correct answer: C

The correct answer is Option C (Foreign Key). A Foreign Key constraint enforces referential integrity by ensuring that a value in one table (the child table) must exist as a valid primary key or unique value in another related table (the parent table). This prevents orphaned records and maintains consistency across the database. For example, if you have an Orders table referencing a Customers table, every customer ID in the Order must exist in the Customer table.

Option A (Primary Key) is incorrect because it uniquely identifies rows within a single table, not across tables.

Option B (Composite Key) is simply a primary key made of multiple columns and does not inherently manage relationships between different tables.

Option D (Unique Key) ensures all values in a column are distinct but does not enforce a link to another table. Therefore, only the Foreign Key constraint specifically guarantees that column values match those in a related table.

Explore the full course: Niacl Ao It Specialist