As stated in CodeTableField Defined, a foreign key identifies a column or a set of columns in one (referencing) table that refers to a column or set of columns in another (referenced) table. These fields establish relationships between two tables. Simply put, a foreign key enforces referential integrity by not allowing orphan records in the database.