MySQL - Foreign Keys

Foreign keys let you cross-reference related data across tables. This is primarily an excellent tool to maintain data integrity, but it can also help the query optimizer with complex queries. This relationship is always a parent -> child relationship where the foreign key is defined in the child table definition.…

Read this article