WGU Data-Management-Foundations Question Answer
Which constraint propagates primary key changes to foreign keys?
SET DEFAULT
SET NULL
RESTRICT
CASCADE
TheCASCADEconstraint ensures thatupdates or deletions in the primary key table automatically reflect in the foreign key table.
Example Usage:
sql
CREATE TABLE Departments (
DeptID INT PRIMARY KEY,
DeptName VARCHAR(50)
);
CREATE TABLE Employees (
EmpID INT PRIMARY KEY,
Name VARCHAR(50),
DeptID INT,
FOREIGN KEY (DeptID) REFERENCES Departments(DeptID) ON UPDATE CASCADE ON DELETE CASCADE
If DeptIDchangesin Departments, itautomatically updatesin Employees.
If a DeptID isdeleted, all employees in that departmentare also deleted.
Why Other Options Are Incorrect:
Option A (SET DEFAULT) (Incorrect):Sets foreign key values to adefaultvalue, rather than propagating changes.
Option B (SET NULL) (Incorrect):When the referenced key is deleted, dependent records areset to NULLinstead of being updated/deleted.
Option C (RESTRICT) (Incorrect):Prevents deletion of a referenced row if dependent foreign key rows exist.
Thus, the correct answer isCASCADE, as itpropagates primary key changes to dependent foreign keys.
TESTED 01 Jan 2026
Copyright © 2014-2026 ACE4Sure. All Rights Reserved