KEY_COLUMN_USAGE table describes
which key columns have constraints. This table provides no
information about functional key parts because they are
expressions and the table provides information only about columns.
KEY_COLUMN_USAGE table has these
The name of the catalog to which the constraint belongs. This value is always
The name of the schema (database) to which the constraint belongs.
The name of the constraint.
The name of the catalog to which the table belongs. This value is always
The name of the schema (database) to which the table belongs.
The name of the table that has the constraint.
The name of the column that has the constraint.
If the constraint is a foreign key, then this is the column of the foreign key, not the column that the foreign key references.
The column's position within the constraint, not the column's position within the table. Column positions are numbered beginning with 1.
NULLfor unique and primary-key constraints. For foreign-key constraints, this column is the ordinal position in key of the table that is being referenced.
The name of the schema referenced by the constraint.
The name of the table referenced by the constraint.
The name of the column referenced by the constraint.
Suppose that there are two tables name
t3 that have the following definitions:
CREATE TABLE t1
CREATE TABLE t3
CONSTRAINT CO FOREIGN KEY (s2) REFERENCES t1(s3)
For those two tables, the
KEY_COLUMN_USAGE table has two rows:
One row with
NDB: This value is always
One row with