On this page
SHOW REFERENCES
Shows the foreign keys of other tables that reference a table.
Syntax
SHOW REFERENCES [<schema>.]<table>
Arguments
| Argument | Required | Values | Default |
|---|---|---|---|
<table> | Yes | The exact table name, in any case | None |
<schema>. | No | The schema of the table, followed by a dot | The 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.
Related
Used in these how-tos
Last modified in release 5.5.0.
Found something wrong or unclear on this page? Tell us, with the page address.