This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am providing one script to find all list of Foreign Key with the source and destination of a MySQL Database.
Using this script you can easily find all foreign key of a MySQL Database and its very useful for Database Architecture to find out different references of foreign keys.
I am finding all Foreign Key references using INFORMATION_SCHEMA.KEY_COLUMN_USAGE.
Below is a script:
referenced_table_name AS ParentTable
,table_name AS ChildTable
,constraint_name AS ConstraintName
WHERE referenced_table_name IS NOT NULL
ORDER BY referenced_table_name;
Please visit Other similar articles.
MySQL: Script to Find Table Dependency
PostgreSQL: Script to find Source and Destination of All Foreign Key Constraint
SQL Server: How to Find Foreign key References?