mysql forign key code example
Example 1: mysql change foreign key
ALTER TABLE Orders
ADD FOREIGN KEY (PersonID) REFERENCES Persons(PersonID);
Example 2: drop foreign key
ALTER TABLE table_name
DROP CONSTRAINT fk_name;
ALTER TABLE Orders
ADD FOREIGN KEY (PersonID) REFERENCES Persons(PersonID);
ALTER TABLE table_name
DROP CONSTRAINT fk_name;