SQL FOREIGN KEYA FOREIGN KEY in one table points to a PRIMARY KEY in another table.
The FOREIGN KEY constraint also prevents that invalid data form being inserted into the foreign key column, because it has to be one of the values contained in the table it points to.
The foreign key can be used to cross-reference tables
SELECT foreign key("column_name") FROM "table_name"
There are two tables given below from which concept of foreign can be understood.