Courseiva
Data Concepts and EnvironmentsmediumMultiple SelectObjective-mapped

DA0-002 Data Concepts and Environments Practice Question

A university database stores student information in a normalized schema. The 'students' table has a primary key 'student_id'. The 'enrollments' table has a foreign key 'student_id' referencing 'students'. Which two of the following are true about primary and foreign keys? (Select TWO)

⚠ Common exam trap

Many candidates assume a foreign key can reference any column, forgetting that the referenced column must have a unique constraint (primary key or unique) to ensure a single target row, which is a common point of confusion in DA0-001.

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 foreign key ensures referential integrity between tables

A foreign key enforces referential integrity by ensuring that every value in the foreign key column of the 'enrollments' table matches a valid primary key value in the 'students' table. This prevents orphaned records and maintains consistency across related tables in a normalized relational database.

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 foreign key must have the same name as the primary key it references

    Why it's wrong here

    Foreign keys can have different names.

  • A foreign key ensures referential integrity between tables

    Why this is correct

    Foreign keys enforce that values match the referenced primary key.

  • A foreign key can reference a column that is not a primary key

    Why it's wrong here

    Foreign keys typically reference a primary key or unique constraint.

  • A table can have multiple primary keys

    Why it's wrong here

    A table can have only one primary key, but it can be composite.

  • A primary key column cannot contain NULL values

    Why this is correct

    Primary keys enforce uniqueness and non-nullability.

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 →

How Courseiva writes practice questions · Editorial policy

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.