Courseiva

FC0-U71 Data and Database Fundamentals Practice Question

A small business stores customer orders in a relational database. The Orders table has a foreign key column named CustomerID that references the Customers table. A developer needs to prevent any order from being inserted if the CustomerID does not already exist in the Customers table. Which database feature should be used?

⚠ Common exam trap

Many exam-takers confuse a unique constraint or an index with referential integrity, when only a foreign key constraint checks that the referenced customer actually exists.

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

✓

A referential integrity constraint

Referential integrity is the relational database rule that a foreign key must reference an existing primary key. It blocks inserts or updates that would create an order with a nonexistent CustomerID. Unique constraints, default values, and indexes serve different purposes and do not validate the relationship between the Orders and Customers tables.

Answer analysis

Option-by-option breakdown

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

  • ✗

    A unique constraint on the CustomerID column in the Orders table

    Why it's wrong here

    A unique constraint would prevent two orders from having the same CustomerID, which is the opposite of what is needed because a customer can place many orders. It does not check whether the CustomerID exists in the Customers table. This option would block legitimate repeat customers and still allow an invalid CustomerID if it were unique.

  • ✓

    A referential integrity constraint

    Why this is correct

    Referential integrity ensures that a foreign key value in one table matches an existing primary key value in the referenced table. By enforcing this constraint, the database rejects any order whose CustomerID is not present in the Customers table. This directly prevents orphaned records and maintains consistent relationships between orders and customers.

  • ✗

    A default value of 0 for the CustomerID column

    Why it's wrong here

    A default value supplies a value when none is provided, but it does not verify that the value exists in the referenced table. An order could be inserted with CustomerID 0 even if no customer has that ID. This option masks missing data rather than enforcing a valid relationship between orders and customers.

  • ✗

    An index on the CustomerID column in the Orders table

    Why it's wrong here

    An index improves the speed of lookups and joins, but it does not enforce any rule about whether the CustomerID exists in the Customers table. Invalid values can still be inserted. This option is a performance optimization, not a data integrity mechanism, so it does not prevent orphaned orders.

About these practice questions

This FC0-U71 question is part of Courseiva's 988-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 FC0-U71 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 FC0-U71 exam.