Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (55.6k points)

Can anyone tell me how to remove the primary key in SQL?

1 Answer

0 votes
by (119k points)

We can use DROP CONSTRAINT command in SQL server to remove the primary key from the table:

ALTER TABLE TableName

DROP CONSTRAINT ColumnName;

In MySQL, here is the syntax to remove the primary key from the table:

ALTER TABLE TableName

DROP PRIMARY KEY;

If you want to become a SQL expert, then take up this SQL training course by Intellipaat that provides instructor-led training and hands-on experience.

Related questions

Browse Categories

...