Learn in the textbookE-R Diagrams, Key Design, and Normalization
DefinitionA foreign key (外部キー) is a column (or set of columns) that refers to primary key values in another table, linking the two tables through those values.
ExplanationA foreign key column cannot hold a value that does not exist in the table it refers to, and this rule is called a referential constraint (referential integrity). In the tables above, it means no student row can point to a class missing from the class table, so the link between the tables stays intact.
AnalogyIt is like the member number written on a delivery slip. The number has to match someone who actually appears in the member list.
Memory hookForeign means it points outside its own table: a foreign key is a signpost to another table.