Data is split across tables, so something has to stop an order from pointing at a customer who does not exist. A foreign key links a child row to a parent row and makes the database enforce that link. Use it whenever one table refers to another, like employee.dept_id pointing to department, and decide what happens when the parent is deleted. Unlike a primary key, a foreign key can repeat and can be NULL, which is a common point of confusion.