Why do I need to use foreign key if I can use WHERE?

前端 未结 10 1393
难免孤独
难免孤独 2020-12-23 16:34

A beginners\' question about foreign key in MySQL.

In w3school it says,

A FOREIGN KEY in one table points to a PRIMARY KEY in another table.<

10条回答
  •  旧时难觅i
    2020-12-23 17:27

    The Foreign is used for referential integrity.

    See An introduction to foreign keys and referential integrity in MySQL

提交回复
热议问题