In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you the setting method of navicat foreign keys, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Now that there are two tables, one is the teacher table and the other is the dept table. Now I want to set the dept property in the teacher table to the foreign key and associate the code property in the dept table. The specific situation is shown in the picture; all right, the basic situation is over, and now I will teach you how to set foreign keys in navicat for mysql.
1. Open my navicat, then find my teacher table, select it, and click 'design table'' on the menu bar.
2. Find "Foreign Keys" in the pop-up dialog box, and then stand alone.
3. Then there will be an interface for setting foreign keys, with a total of seven columns. Briefly introduce the meaning of these columns.
Name': can be left unfilled, and the system will be generated automatically if you save it later.
FieldName': is which key you want to set as a foreign key. Choose 'dept'' here
'The database associated with the Reference DadaBase': foreign key.
Reference Table': the associated table here is the dept table
'The field associated with Forgin filed Names':. Here is code.
'ondelete': is the action you choose when deleting. My choice here is setNull, which means that when the associated table is deleted, the teacher "dept field is set to null.
Onupdate': is the action you choose when you update. My choice here is CASCADE, which means that when the associated table is updated, the teacher "dept field is set to cascading updates.
4. Click 'save' to save and exit' after setting up, or click 'add Foreign Key' to add a foreign key.
The above is all the contents of this article "how to set navicat Foreign Keys". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.