How to delete specific data from a database table in MySQL?
To remove specific data from a MySQL database table, you can use the DELETE statement.
Syntax:
DELETE FROM table_name WHERE condition;
Suppose we have a table named “users” that includes the following data:
– The table includes columns for ID, name, and email, with entries for John, Jane, and Alice.
If you want to delete the row with the email “jane@example.com”, you can execute the following command:
Remove the user with the email address ‘jane@example.com’ from the database.
After executing the above command, the data in the table will be deleted, resulting in the following outcome:
| id | name | email |
|—-|——-|——————-|
| 1 | John | john@example.com |
| 3 | Alice | alice@example.com |