How to DROP Foreign Key
The foreign key can be dropped using the DROP FOREIGN KEY clause. Here’s the basic syntax:
ALTER TABLE <table_name>
DROP FOREIGN KEY foreign_key_name;
MySQL FOREIGN KEY Constraint
FOREIGN KEY is a field in a table that refers to a unique key in another table. It is used for linking one or more than one table together. Another name for FOREIGN KEY is referencing key. It creates a link (relation) between two tables thus creating referential integrity.
The FOREIGN KEY creates a relationship between the columns in the current table or let’s say table A (the one with the foreign key) and the referenced table or table B (the one with the unique key). This creates a parent-child type of relationship where the table with the FOREIGN KEY in the child table refers to the primary or unique key column in the parent table.