The REFERENTIAL_CONSTRAINTS
table
provides information about foreign keys.
INFORMATION_SCHEMA Name | SHOW Name | Remarks |
---|---|---|
CONSTRAINT_CATALOG | def | |
CONSTRAINT_SCHEMA | ||
CONSTRAINT_NAME | ||
UNIQUE_CONSTRAINT_CATALOG | def | |
UNIQUE_CONSTRAINT_SCHEMA | ||
UNIQUE_CONSTRAINT_NAME | ||
MATCH_OPTION | ||
UPDATE_RULE | ||
DELETE_RULE | ||
TABLE_NAME | ||
REFERENCED_TABLE_NAME |
Notes:
TABLE_NAME
has the same value asTABLE_NAME
inINFORMATION_SCHEMA.TABLE_CONSTRAINTS
.CONSTRAINT_SCHEMA
andCONSTRAINT_NAME
identify the foreign key.UNIQUE_CONSTRAINT_SCHEMA
,UNIQUE_CONSTRAINT_NAME
, andREFERENCED_TABLE_NAME
identify the referenced key.The only valid value at this time for
MATCH_OPTION
isNONE
.The possible values for
UPDATE_RULE
orDELETE_RULE
areCASCADE
,SET NULL
,SET DEFAULT
,RESTRICT
,NO ACTION
.