Answer

A foreign key (FK) is a column in one table that references the primary key of another table, establishing a link between the two tables. It enforces referential integrity — ensuring that a value in the FK column must exist as a PK in the referenced table (no orphan records). Example: orders.customer_id is a foreign key referencing customers.id. FK constraints support cascade actions: ON DELETE CASCADE (deletes child rows when parent is deleted), ON DELETE SET NULL, and ON DELETE RESTRICT (prevents deletion if children exist).