Can't Drop foreign key in MySQL

后端 未结 7 649
粉色の甜心
粉色の甜心 2020-12-04 19:37

I have had a 1 to many relationship between course and instructor, which I wanted to drop. When I tried to drop the instructorID in course table it told me that. I couldn\'t

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-04 20:30

    To drop a FOREIGN KEY constraint:

    MySQL:

    ALTER TABLE Orders DROP FOREIGN KEY {Constraint/Key_name};
    

    For SQL Server / Oracle / MS Access:

    ALTER TABLE Orders DROP CONSTRAINT {Constraint/Key_name};
    

提交回复
热议问题