Example of such query for MySQL:
SELECT
ku.CONSTRAINT_NAME AS "Foreign key",
CONCAT("`", ku.TABLE_SCHEMA, "`.`", ku.TABLE_NAME, "`") AS "In",
GROUP_CONCAT(ku.COLUMN_NAME) AS "Source column",
CONCAT("`", ku.REFERENCED_TABLE_SCHEMA, "`.`", ku.REFERENCED_TABLE_NAME, "`") AS "References",
GROUP_CONCAT(ku.REFERENCED_COLUMN_NAME) AS "Target column"
FROM information_schema.KEY_COLUMN_USAGE AS ku
WHERE ku.REFERENCED_TABLE_SCHEMA = '[THE_CURRENT_SELECTED_SCHEMA_NAME]'
AND ku.REFERENCED_TABLE_NAME = '[THE_CURRENT_SELECTED_TABLE_NAME]'
GROUP BY ku.CONSTRAINT_NAME
HAVING `In` != `References`
Result:
Foreign key; In; Source column; References; Target column
FK_map_element_isometric_map_element_country; `eclerd_earthprime`.`map_element_isometric`; id_map_element_country; `eclerd_earthprime`.`map_element_country`; id
Without the HAVING
, we could get all the foreign keys (but those defined in the current selected table are already listed in the "Foreign Key" tab, so these rows are quiet useless here).
[I hope that post won't crask up the forum's display...]