In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to add constraints in navicat. I hope you will get something after reading this article. Let's discuss it together.
Open the navicat tool to connect to the mysql service, and then choose to open a database. Here, select a test database for the demonstration, and then give the foreign keys to the user table and the school table. Select the t_user table and click the design table.
On the design table page, the default is the field page, where you can edit the field content for the table, and we select the foreign key option.
On the foreign key setting page, select the button on the right side of the second column. The first column can be left empty and a foreign key name will be automatically generated. If you need a standard name, you can customize one.
In the pop-up field drop-down list, select a field to which you want to add a foreign key, here is to add a foreign key to the school table, so select school_id.
Then select the reference table, that is, the table pointed to by the foreign key, the reference database can not be selected, the default is the current database. Refer to the table and select the school table t_school_info.
Refer to the selection of fields, because the constraints between the two tables are associated with id, so you can choose id here.
Finally, the constraint rules are deleted and updated. If you choose to cascade delete CASCADE, the school table data will be cascaded to delete user data, or you can choose the method of RESTRICT constraint. You must delete all the associated users of a school before you can delete the school information.
After the above selection is completed, click Save, and the foreign key constraint will take effect. You can edit the data in the table to see the effect.
After reading this article, I believe you have a certain understanding of "procedures for adding constraints in navicat". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.