Courseiva

DA0-002 Data Concepts and Environments Practice Question

A database administrator wants to ensure that every value in a column matches values in a primary key column of another table. Which constraint enforces this rule?

⚠ Common exam trap

DA0-002 often tests the confusion between unique constraints and foreign keys, since both involve uniqueness — candidates must remember that only a foreign key enforces a cross-table reference to a primary key.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Foreign key

A foreign key constraint enforces referential integrity by requiring that values in a column match values in the primary key (or unique key) column of another table. This is exactly the rule described — ensuring every value in one table's column corresponds to a primary key value in another table.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Unique constraint

    Why it's wrong here

    A unique constraint enforces distinctness within one table's own column, not cross-table referential matching. It is tempting because it also restricts duplicate values, but that mechanism operates on a single table; a foreign key is what references another table's primary key.

  • ✗

    Primary key

    Why it's wrong here

    A primary key enforces uniqueness and non-nullability within its own table; it cannot reference a different table's column. It is tempting because primary keys are the referenced target, yet the constraint doing the referencing on the child column is a foreign key.

  • ✗

    Check constraint

    Why it's wrong here

    A check constraint validates values within the same row against a logical expression; it cannot reference another table's primary key column. It is tempting because it enforces domain rules such as ranges, and would be correct for constraining a column's permitted values — referential integrity across tables requires a foreign key.

  • ✓

    Foreign key

    Why this is correct

    A foreign key constrains each value in the child column to exist in the referenced primary key column of the parent table, enforcing referential integrity and rejecting inserts or updates that would orphan the row.

About these practice questions

Courseiva writes every DA0-002 question from scratch — 1,004 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CompTIA exam blueprint

This DA0-002 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DA0-002 exam.