Skip to content

Instantly share code, notes, and snippets.

@Hazem-Ben-Khalfallah
Last active December 30, 2019 11:49
Show Gist options
  • Select an option

  • Save Hazem-Ben-Khalfallah/8ef79134a5bc2a35ff80256e3e188136 to your computer and use it in GitHub Desktop.

Select an option

Save Hazem-Ben-Khalfallah/8ef79134a5bc2a35ff80256e3e188136 to your computer and use it in GitHub Desktop.
[Show all table constraints] #sql
SELECT TABLE_NAME,
COLUMN_NAME,
CONSTRAINT_NAME,
REFERENCED_TABLE_NAME,
REFERENCED_COLUMN_NAME
FROM information_schema.KEY_COLUMN_USAGE
WHERE TABLE_NAME = "<TABLE_NAME>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment