Last answered:

08 Mar 2024

Posted on:

04 Mar 2024

0

DROPPING COLUMN AND UNREFERENCED IT AS A FOREIGN KEY

How can I drop a column? and how can I unreferenced a column as a foreign key.

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

08 Mar 2024

2

Hi Abayomi-Rufai!
Thanks for reaching out.


To drop a column in MySQL:

ALTER TABLE table_name DROP COLUMN column_name;

To remove a foreign key reference from a column in MySQL:

ALTER TABLE table_name DROP FOREIGN KEY constraint_name;


Hope this helps.
Best,
Tsvetelin

Submit an answer