In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces mysql what foreign key constraint level related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe you will have something to gain after reading this mysql what foreign key constraint level article, let's take a look at it.
1. Cascade mode.
When the update/delete record is on the master table, the matching record of the update/delete slave table is synchronized.
2. Set null mode.
When the update/delete record is on the master table, the column that matches the record on the slave table is set to null, but it should be noted that the foreign key column of the child table cannot be notnull.
3. No action mode.
If there are matching records in the child table, update/delete is not allowed to operate on the candidate key corresponding to the parent table.
4. Restrict method, which is the same as no action.
Check the foreign key constraint immediately.
5. Set default mode, white space may be displayed in the visualization tool SQLyog.
When the parent table changes, the child table sets the foreign key column to the default value, but Innodb does not recognize it.
Example
-Department table create table dept (id int primary key,dept_name varchar (50), dept_location varchar (50));-employee form CREATE TABLE emp (eid int primary key,name varchar (50) not null,sex varchar (10), dept_id int) Add a foreign key to the dept_id of the employee table and point to the primary key alter table emp add foreign key (dept_id) references dept (id) of the department table. This is the end of the article on "what foreign key constraint level does mysql have?" Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "what foreign key constraint level mysql has". If you want to learn more knowledge, you are 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.