On this page

SHOW REFERENCES

Core command SHOW REFS SH REF SHREF

Shows the foreign keys of other tables that reference a table.

Syntax

SHOW REFERENCES [<schema>.]<table>

Arguments

ArgumentRequiredValuesDefault
<table>YesThe exact table name, in any caseNone
<schema>.NoThe schema of the table, followed by a dotThe current schema

Examples

SHOW REFERENCES CUSTOMER;
SHOW REFS SALES.CUSTOMER;

Details

Output

The inverse of SHOW FK: one row per column of each foreign key pointing to this table, with the referencing table, the constraint name, the column position within the key (#), the referencing column and the column of this table it references. A referencing table in another schema is shown qualified. A table that references itself appears too.

Table name and errors

The table is found as for DESCR. When no foreign key references the table, the command says so. It fails when no table name is given, when the table does not exist or is ambiguous, or when the JDBC driver cannot provide foreign key metadata.

  • SHOW FK, the opposite direction
  • DESCR, how the table name is found

Used in these how-tos

Last modified in release 5.5.0.

Found something wrong or unclear on this page? , with the page address.