Courseiva
hardMultiple ChoiceObjective-mapped

FC0-U71 Practice Question: A university database includes a table named…

A university database includes a table named 'Students' and a table named 'Enrollments'. The 'Enrollments' table has a foreign key column 'StudentID' that references the 'StudentID' primary key in the 'Students' table. The university policy requires that when a student withdraws (i.e., their record is deleted from the 'Students' table), all of their associated enrollment records must be automatically removed to maintain data consistency. The database administrator wants to enforce this rule at the database level. Which referential action should be applied when creating the foreign key constraint on the 'Enrollments' table?

⚠ Common exam trap

Watch out — candidates often confuse ON DELETE CASCADE with ON DELETE SET NULL or ON DELETE RESTRICT, mistakenly thinking that preventing deletion or setting NULL satisfies the automatic removal requirement, when only CASCADE actually deletes the child records automatically.

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

ON DELETE CASCADE

(ON DELETE CASCADE) is correct because it automatically deletes all child rows in the 'Enrollments' table when the corresponding parent row in the 'Students' table is deleted. This enforces the university policy of removing associated enrollment records upon student withdrawal, maintaining referential integrity at the database level without manual intervention.

Answer analysis

Option-by-option breakdown

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

  • ON DELETE CASCADE

    Why this is correct

    CASCADE automatically deletes child records when parent is deleted.

  • ON DELETE SET NULL

    Why it's wrong here

    SET NULL would orphan enrollment records with NULL StudentID, not delete them.

  • ON DELETE NO ACTION

    Why it's wrong here

    NO ACTION (like RESTRICT) prevents deletion if child records exist.

  • ON DELETE RESTRICT

    Why it's wrong here

    RESTRICT prevents deletion if child records exist, not desired.

About these practice questions

Courseiva writes every FC0-U71 question from scratch — 988 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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 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.