Skip to main content

Get all Foreign key relationship with a table and its column

To get all the Foreign key referenced table and its column, use below query in MySQL.

            select table_name, column_name, constraint_name, referenced_table_name, referenced_column_name from information_schema.key_column_usage where referenced_table_schema = 'dbName' and referenced_table_name = 'tableName' and referenced_column_name = 'columnName';

Comments

Popular posts from this blog