Skip to main content
Remove records using the DELETE operation.

Basic Syntax

Both forms are valid. The FROM keyword is optional.

Delete Single Record

Delete with Conditions

Delete with IN

Delete with LIKE

Delete with NULL Check

Delete with BETWEEN

Complete Examples

Remove Expired Sessions

Clean Up Old Logs

Remove Unverified Users

Cancel Abandoned Orders

Remove Test Data

Soft Delete Alternative

Instead of deleting, consider soft delete:

Truncate

Remove all records from a table. Both syntaxes work:
Warning: TRUNCATE removes ALL records and cannot be rolled back in most databases.

Warning

Always include a WHERE clause to avoid deleting all records accidentally.

Next Steps

Create Tables

Define your schema

Transactions

Group operations safely