How to determine a foreign key in a MySQL database?

How to define a foreign key in a DB DB table?

+3
source share
1 answer

From http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html

SHOW CREATE TABLE tbl_name;

You can also display foreign key constraints for a table as follows:

SHOW TABLE OF STATUS FROM db_name LIKE 'tbl_name';

+2
source

Source: https://habr.com/ru/post/1740301/


All Articles