- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to disable MySQL foreign key checks and what are the benefits of disabling it?
We can disable foreign key checks with the help of the following statement −
mysql> Set foreign_key_checks = 0; Query OK, 0 rows affected (0.00 sec)
And we can enable it with the help of the following statement −
mysql> Set foreign_key_checks = 1; Query OK, 0 rows affected (0.00 sec)
Some benefits of disabling foreign key checks are as follows −
- After disabling foreign key checks we can load data into parent and child table in any order. Otherwise, we must have to load the data first in the parent table and then in the child table.
- Without disabling foreign key checks we cannot drop a table that is referenced by a foreign key constraint.
- Verify that MySQL SET FOREIGN KEY CHECKS is set to = 1?
- What do you mean by FOREIGN KEY and how can we use it in MySQL table?
- MySQL Syntax to create Foreign Key?
- How to identify foreign key in MySQL DB?
- sp_help for MySQL to display field types and foreign key constraints?
- Difference between Primary key and Foreign key in Database
- Difference Between Primary key and Foreign key in DBMS
- Foreign Key in RDBMS
- How to refer primary key as Foreign to various table in MySQL?
- Difference between Primary key and Foreign key in SQL Database
- What are the benefits of meditation?
- What are the benefits of wheatgrass?
- What are the benefits and drawbacks of using Canva?
- Get a list of Foreign Key constraints in MySQL
- How to use Primary Key Constraints and Foreign Key Constraints to enforce database integrity in Oracle?