Show answerHide answer
Correct answer: B Foreign key
Explanation
Explanation:A foreign key is the constraint specifically designed to enforce referential integrity between two tables. It ensures that values in a column (or columns) in one table match values in the primary key or unique key column of another table (or the same table). This maintains consistency by preventing actions that would orphan records or create invalid links.
Why other options are incorrect:
A. Surrogate key:
Incorrect. A surrogate key is an artificial primary key (often an auto-incrementing number) with no business meaning. It does not enforce relationships between tables.
C. Unique key:
Incorrect. A unique key constraint ensures all values in a column (or set of columns) are distinct (except NULLs), but it does not define relationships between tables.
D. Primary key:
Incorrect. A primary key uniquely identifies each row within its own table. While foreign keys often reference primary keys, the primary key itself does not enforce referential integrity.
Reference:
CompTIA DataSys+ DS0-001 Objective 1.3: "Given a scenario, create and modify database objects using scripts and SQL." This includes understanding constraints, particularly foreign keys for maintaining referential integrity.

