Find code and diagrams at: https://www.EliTheComputerGuy.com
Updating and Deleting records in a table is very easy. Remember that MySQL does not ask for verification of a command, and so a poorly written statement can be devastating to a database.
update users set column1=‘x’ where column2=’a’; – Updates ALL records where condition is true
update users set column1=‘x’ where column2=’a’ and column3=‘b’; – Updates ALL records where two conditions are true
update users set column1=‘x’, column2=‘y’ where column3=’a’ ; – Updates two columns where condition is true
delete from table where column=‘x’; – Deletes ALL records where the conditions is true
delete from table where column1=‘x’ and column2=‘y’; – Deletes ALL records where two conditions are true
Watch video MySQL - Update and Delete Records (update, delete) online without registration, duration hours minute second in high quality. This video was added by user Eli the Computer Guy 22 November 2019, don't forget to share it with your friends and acquaintances, it has been viewed on our site 3,486 once and liked it 119 people.