mediumMultiple ChoiceObjective-mapped
FC0-U71 Practice Question: A company's customer database contains a table…
A company's customer database contains a table named 'Orders' with columns: OrderID, CustomerID, ProductID, Quantity, OrderDate. The company wants to enforce that every CustomerID in 'Orders' must exist in the 'Customers' table. Which database constraint should be added to the 'Orders' table?
⚠ Common exam trap
A common mix-up: candidates confuse a foreign key with a primary key or a unique constraint, mistakenly thinking that enforcing uniqueness or a simple check is sufficient to link two tables, when only a foreign key provides cross-table referential integrity.
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 on CustomerID referencing Customers
A foreign key constraint on the CustomerID column in the Orders table ensures referential integrity by requiring that every value entered in that column must match a CustomerID value in the Customers table. This prevents orphan records and maintains consistency between the two tables, which is the standard relational database approach for enforcing such a relationship.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Check constraint on CustomerID
Why it's wrong here
A check constraint can validate conditions like CustomerID > 0, but cannot verify existence in another table.
- ✗
Primary key on CustomerID
Why it's wrong here
A primary key would require uniqueness and non-null for CustomerID, but does not enforce existence in another table.
- ✓
Foreign key on CustomerID referencing Customers
Why this is correct
A foreign key ensures that CustomerID values in Orders match a primary key value in Customers.
- ✗
Unique constraint on CustomerID
Why it's wrong here
A unique constraint only ensures no duplicate CustomerID values in Orders, not that they exist in Customers.
Go deeper
Related to this question
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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.