I am trying to learn working with SQL and I am coding in mysql workbench and I can't understand why the code in below doesn't work. It says it has a syntax error but I don't know where.

ALTER TABLE TABLE_ONE DROP FOREIGN KEY

2 Answers

2
mkRabbani On Best Solutions

Try this-

ALTER TABLE TABLE_ONE DROP FOREIGN KEY FK_Name
1
Harvey On

You need to type the name of the specific foreign key to drop.

ALTER TABLE table_name DROP FOREIGN KEY id_name_fk;