top of page

Removing a Primary key

Commands for removing a Primary Key from a Table !!


Some Existing Tables :

To get the list of existing tables use command :


SHOW TABLES;

Table Test :

This table has ID as it's Primary key :

Use "Describe" command to know the structure of the table.

DESC TEST;

Removing Primary Key

By using "Alter" command primary key can be removed from this table test.

ALTER TABLE TEST DROP PRIMARY KEY;

Result :

To check use "Describe" command :

DESC TEST;

Comments


bottom of page