A foreign key requires a value in a child table to refer to a candidate key in the parent table. The database rejects invalid references.
Deleting a parent applies the configured action, such as restriction, cascade, or setting a default. The demo shows deletion being blocked while an order still refers to a customer. Choose cascade only after checking its impact.
When to use
Use it when the database should enforce referential integrity between tables.