There are three ways to view foreign key views in Navicat: direct access (find views starting with "FK_"), query the view (right-click "Query Data" from the view node), or expand INFORMATION_SCHEMA.KEY_COLUMN_USAGE table and use appropriate filters to identify foreign key references.
How to use Navicat to view foreign key views
Direct access
Query View
<code class="sql">SELECT * FROM <view_name></code>
where <view_name>
is the name of the foreign key view you want to view.
Expand INFORMATION_SCHEMA.KEY_COLUMN_USAGE
Table
INFORMATION_SCHEMA.KEY_COLUMN_USAGE
table. TABLE_NAME
: The table where the foreign key residesCONSTRAINT_NAME
: The name of the foreign key constraint REFERENCED_TABLE_NAME
: The referenced table REFERENCED_COLUMN_NAME
: The referenced column Example
Suppose we have a table named Customers
which contains a foreign key named customer_id
which references # The order_id
column in the ##Orders table.
.
view and select "Query Data".
Table:
In the filter, specify TABLE_NAME as
Customers,
CONSTRAINT_NAME is
FK_Customers_Orders,
REFERENCED_TABLE_NAME is
Orders,
REFERENCED_COLUMN_NAME is
order_id.
The above is the detailed content of How to see foreign key view in navicat. For more information, please follow other related articles on the PHP Chinese website!