What is a FOREIGN KEY constraint?
A FOREIGN KEY constraint (also known as referential integrity constraint) specifies that each value in a specified column or set of columns must match a value in another table’s unique or primary key (column or set of columns protected by a UNIQUE or PRIMARY KEY constraint). A column or set of columns protected by a FOREIGN KEY constraint is known as a foreign key. A table having a foreign key is called child table. A table having a unique or primary key referenced by a foreign key is called parent table. A table’s foreign key can reference to the same table’s unique or primary key. A foreign key can contain duplicate and NULL values.