Search⌘ K
AI Features

Deleting Rows from Tables

Explore how to use the SQL delete command to remove rows from MySQL tables safely. Learn to specify conditions with the where clause to delete only the intended data, verify with select queries, and avoid deleting entire tables accidentally.

We'll cover the following...

Syntax for the delete query

Let’s look at the delete query below:

  1. The delete keyword is used to delete any data from the table.
  2. This item tells us which table we want to delete data from. In this case, it’s customers.
  3. The where clause is given at the delete statement between the table name and the condition, depending on what data we want to delete.
  4. In the end, we impose the condition to delete the record, name = "John papa".

Let’s learn more about the delete command. What if we wanted to delete the customer with the name John Papas?

We can use the following command to delete a row ...