Javatpoint Logo
Javatpoint Logo

Drop a Foreign Key

ALTER TABLE statement is used to drop a foreign key from a table once it has been created.

Syntax:

Parameter explanation

table_name: It specifies the name of the table where the foreign key has been created.

fk_name: It specifies the name of the foreign key that you want to remove.

Example:

In the previous example we have seen how to create a foreign key.

Use the following command to drop the foreign key called fk_inv_product_id.

Output:

SQL Drop a foreign 1

Now the foreign key is dropped.



Next TopicSS Create View





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA