I am new to programming and still learning. I have a project which is developed using PHP and MySQL. I’m facing an issue in SQL where I wanted to drop the primary key for the table I created. It would be helpful for me if anyone can help me on this.
This is my query:
ALTER TABLE `contract_extension_survey` DROP PRIMARY KEY `worker_id`;
2
Answers
To drop a primary key column in MySQL, you want to use the following syntax:
So in your case it would be something like:
From DROP INDEX Statement
In your case ,
Or written a little longer
See example
See Primary Keys and Indexes