Last answered:

09 May 2023

Posted on:

20 Nov 2022

1

DROP statement not working

Error Code: 3730. Cannot drop table 'customers' referenced by a foreign key constraint 'constraints_1' on table 'sales'.
what does this error mean please?

2 answers ( 0 marked as helpful)
Instructor
Posted on:

23 Nov 2022

0

Hi Bassey!
Thanks for reaching out.

You have to delete the foreign key name instead of the column name and it will work. Please, use the following code:

ALTER TABLE sales
DROP FOREIGN KEY constraints_1;

Hope this helps.
Best,
Tsvetelin

Posted on:

09 May 2023

0

Bwfore writing you code you should drop foreign kein in sales table I think.

Submit an answer