DA0-002 Data Concepts and Environments Practice Question
A retail company wants to analyze customer purchase patterns over time. The data is stored in a relational database with tables for Customers, Orders, and Products. Which database concept should be used to ensure that each order references a valid customer?
⚠ Common exam trap
CompTIA often tests the distinction between a primary key (which enforces uniqueness within a table) and a foreign key (which enforces relationships between tables), leading candidates to mistakenly choose primary key when the question asks about cross-table validation.
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 ensuring that every value in the 'customer_id' column of the Orders table matches a valid primary key value in the Customers table. This prevents orphaned records and guarantees that each order references an existing customer.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
View
Why it's wrong here
A view is a virtual table based on a query, not used for enforcing relationships.
- ✗
Index
Why it's wrong here
An index speeds up data retrieval but does not enforce referential integrity.
- ✗
Primary key
Why it's wrong here
A primary key uniquely identifies each row within its own table, but does not enforce relationships between tables.
- ✓
Foreign key
Why this is correct
A foreign key links tables by referencing a primary key in another table, maintaining referential integrity.
Go deeper
Related to this question
About these practice questions
One of 986 original DA0-002 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.