0

Is it possible, from the MySQL command line, to list in a single query all the indexes/constraints/FKs etc that are in the database in question?

Thanks in advance

Rich

Rich
  • 1,343
  • 7
  • 28
  • 39

2 Answers2

1

We can also refer to INFORMATION_SCHEMA.TABLE_CONSTRAINTS dictionary table providing TABLE_SCHEMA and CONSTRAINT_TYPE in where clause/

CONSTRAINT_TYPE could be 'UNIQUE'/'PRIMARY KEY'/FOREIGN KEY'

Mahesh
  • 11
  • 1
0

Take a look into information_schema database, maybe these tables can help you:

  • REFERENTIAL_CONSTRAINTS
  • COLUMNS table (column COLUMN_KEY)
lg.
  • 4,649
  • 3
  • 21
  • 20