database

How do I delete a record from my MySQL database?

Deleting a record from your MySQL database is pretty easy, but it’s always good to confirm the delete before doing so.

For example, if you want to delete all users named ‘John%’ you could first do a select to confirm how many records would be impacted.

select name, address, phone_number from users where name like ‘John%’;

If the results look OK, you could then delete those records like so:

delete from users where name like ‘John%’;

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

To Top