Drop Primary Key
To drop/remove a primary key from a table you can use the ALTER TABLE statement.
Syntax
ALTER TABLE table_name DROP PRIMARY KEY;
Example
Query to drop primary key by using ALTER TABLE statement:
ALTER TABLE w3wiki DROP PRIMARY KEY;
MySQL Primary Key
MySQL is an open-source relational database management system that uses Structured Query Language (SQL) to manipulate databases. It stores data in a table format and to uniquely identify each record in a table, we require a Primary Key.
In this article, we will learn how to add, modify, and remove the primary key in MySQL tables with examples.