Handy MySQL Commands-II

  1. To update info already in a table.
mysql> UPDATE Persons SET PersonId = 2 where FirstName = 'Ankur';
mysql> DELETE from Persons where PersonId = 2;
mysql> alter table Persons add column newClm varchar(20);
mysql> alter table Persons drop column newClm;
mysql> alter table Persons change column FirstName First varchar(20);
mysql> alter table Persons add unique (PersonId);
mysql> alter table Persons modify First varchar(255);
mysql> alter table Persons drop index PersonId;

--

--

I’m a MERN Developer. ( Redux | AWS | Python ) I enjoy taking on new things, building skills, and sharing what I’ve learned.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ankit Kumar Rajpoot

I’m a MERN Developer. ( Redux | AWS | Python ) I enjoy taking on new things, building skills, and sharing what I’ve learned.