O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Deleting

Deleting a record can be done as follows:

mysql> DELETE FROM customers WHERE id=4 AND first_name='Rajiv';Query OK, 1 row affected (0.03 sec)
The WHERE clause is mandatory. Failing to give it will DELETE all the rows of the table. It is recommended to do data modification in a transaction, so that you can easily rollback the changes if you find anything wrong.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required