Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffjohnson9046/fe7d0fb9886ef14951678b8b97602d6f to your computer and use it in GitHub Desktop.
Save jeffjohnson9046/fe7d0fb9886ef14951678b8b97602d6f to your computer and use it in GitHub Desktop.
MySQL - Identify other tables that reference a table by a foreign key constraint
SELECT *
FROM information_schema.KEY_COLUMN_USAGE
WHERE table_schema = /* the schema you're interested in */
AND referenced_table_name = /* name of the table that is referenced by other tables via foreign key */;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment