Removing a Primary key
- vardhman0000
- Jul 16, 2021
- 1 min read
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