Courseiva

DA0-002 Data Concepts and Environments Practice Question

A database has a table 'Orders' with columns OrderID (PK), CustomerID, OrderDate, and a table 'OrderDetails' with OrderID (FK), ProductID, Quantity. To ensure that every OrderID in OrderDetails exists in Orders, which integrity constraint is enforced?

⚠ Common exam trap

Many candidates confuse the four integrity types—candidates often pick 'entity integrity' because it sounds like it relates to keys, but entity integrity is specifically about primary keys, not foreign keys.

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

✓

Referential integrity

Referential integrity ensures that a foreign key value in a child table (OrderDetails.OrderID) must match an existing primary key value in the parent table (Orders.OrderID) or be NULL. This constraint prevents orphaned records and maintains consistent relationships between tables. Since OrderDetails.OrderID is defined as a foreign key referencing Orders, the database enforces referential integrity to guarantee every OrderID in OrderDetails exists in Orders.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Entity integrity

    Why it's wrong here

    Entity integrity requires primary keys to be unique and non-null within a single table, so it cannot enforce cross-table matching. Referential integrity is the constraint ensuring every OrderDetails.OrderID exists in Orders; entity integrity would suit preventing duplicate OrderID values.

  • ✗

    Domain integrity

    Why it's wrong here

    Domain integrity constrains column values to a permitted set or data type, not cross-table row existence. Referential integrity governs the foreign key relationship ensuring each OrderDetails.OrderID exists in Orders; domain constraints would suit validating Quantity ranges.

  • ✗

    User-defined integrity

    Why it's wrong here

    User-defined integrity enforces bespoke business rules, not the parent-child row matching between Orders and OrderDetails. The stem describes a foreign key referencing a primary key, which is referential integrity. User-defined integrity would be correct for a custom rule such as Quantity never exceeding 100, which no built-in constraint type covers.

  • ✓

    Referential integrity

    Why this is correct

    Referential integrity guarantees that every foreign key value in OrderDetails matches an existing primary key in Orders, preventing orphaned detail rows. This directly enforces the stem's requirement that each OrderID in OrderDetails exists in the parent Orders table.

About these practice questions

This DA0-002 question is part of Courseiva's 1,004-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.