Loading Data Driven Insights
Preparing your learning content.
Preparing your learning content.
A beginner-friendly guide to the SQL DELETE statement, with SQL Server-friendly examples for removing rows from a table safely.
The DELETE statement is used to remove rows from a table.
You can use DELETE when you want to delete one row, delete selected rows, remove records by condition, clean unwanted data, or remove row data while keeping the table structure.
A basic DELETE statement names the table and uses a WHERE condition to control which row should be deleted.
DELETE FROM table_name
WHERE condition;
DELETE FROM Employees
WHERE employee_id = 6;
employee_id = 6.We will delete Ethan Moore’s row from this table.
This query deletes only one row because the WHERE condition matches one employee.
DELETE FROM Employees
WHERE employee_id = 6;
This query deletes only one row because the WHERE condition matches one employee.
Without WHERE, SQL may delete every row from the table.
DELETE FROM Employees;
DELETE FROM Employees
WHERE employee_id = 6;
DELETE removes rows from a table. Always use a clear WHERE condition when you only want to delete specific rows.
Learning SQL in order?
Use the roadmap to follow each SQL topic step by step, from relational database basics to advanced query techniques.
Back to SQL RoadmapRelated lessons
ALTER TABLE
A beginner-friendly guide to ALTER TABLE in SQL, including how to add, change, and remove columns from an existing table.
CREATE TABLE
A beginner-friendly guide to the SQL CREATE TABLE statement, including table planning, column names, data types, and a SQL Server-friendly example.
GROUP BY
A beginner-friendly guide to the SQL GROUP BY clause, with SQL Server-friendly examples using COUNT and SUM.