Home  >  Article  >  Database  >  How to set foreign keys in navicat

How to set foreign keys in navicat

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-08-12 16:45:1218772browse

How to set foreign keys in navicat

Open Navicat.

How to set foreign keys in navicat

Open the database where the data table is located, right-click the database table where you want to add fields, and then click [Design Table].

How to set foreign keys in navicat

Now enter the table design interface.

How to set foreign keys in navicat

Related recommendations: "Navicat for mysql graphic tutorial"

Click the [Foreign Key] tab and enter the foreign key Name, such as product id.

How to set foreign keys in navicat

# In the field selection dialog box, select the field to create a foreign key, such as the productid field, and then click [OK].

How to set foreign keys in navicat

Select a reference database, such as sparrow.

How to set foreign keys in navicat

Select a reference table, such as product.

How to set foreign keys in navicat

Select the reference field, such as product_id.

How to set foreign keys in navicat

Set the operation when foreign key is deleted, such as set null.

How to set foreign keys in navicat

#Set the operation when updating the foreign key, such as restrict, and then click [Save] to create the foreign key.

How to set foreign keys in navicat

The above is the detailed content of How to set foreign keys in navicat. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn