Quick answer

INSERT adds new rows. UPDATE changes existing rows. DELETE removes rows.

These are the main SQL commands used to modify data inside a table. They are essential, but they also require more caution than a normal SELECT query because they change the database.

Tip: Beginners should be extra careful with UPDATE and DELETE. A missing WHERE clause can affect every row in the table.

In this guide

Sample table

Imagine you have a table called employees:

employee_id name department salary city
1 Ana Sales 62000 Chicago
2 Ben IT 78000 Dallas
3 Chris HR 56000 Chicago
We’ll use this table for all the examples below so you can clearly see what each command changes.

How INSERT works

INSERT adds a new row to a table.

INSERT INTO employees (employee_id, name, department, salary, city)
VALUES (4, 'Dana', 'IT', 85000, 'Denver');

That query adds a brand-new employee row for Dana.

Why listing columns is a good habit

You can sometimes write an INSERT without explicitly listing column names, but beginners should avoid that. Listing the columns makes the query easier to read and much safer if the table structure changes later.

Beginner rule: always list the columns in INSERT INTO unless you have a very specific reason not to.

What the table would look like after the INSERT

employee_id name department salary city
1 Ana Sales 62000 Chicago
2 Ben IT 78000 Dallas
3 Chris HR 56000 Chicago
4 Dana IT 85000 Denver

How UPDATE works

UPDATE changes values in existing rows.

UPDATE employees
SET city = 'Austin'
WHERE employee_id = 2;

This changes Ben’s city from Dallas to Austin.

You can update other columns too

UPDATE employees
SET salary = 60000
WHERE name = 'Chris';

This changes Chris’s salary to 60000.

You can update multiple columns at once

UPDATE employees
SET department = 'Finance',
    city = 'Boston'
WHERE employee_id = 1;
UPDATE is powerful because it can change many rows at once, but that is also what makes it dangerous.

How DELETE works

DELETE removes rows from a table.

DELETE FROM employees
WHERE employee_id = 3;

This removes Chris’s row from the table.

Unlike UPDATE, which changes the values inside a row, DELETE removes the whole row entirely.

If you only want to change a value, use UPDATE. If you want the row gone, use DELETE.

Why WHERE matters

The WHERE clause tells SQL which rows should be updated or deleted. Without it, SQL may apply the command to every row in the table.

Dangerous UPDATE example

UPDATE employees
SET city = 'Miami';

That would change the city for every employee.

Dangerous DELETE example

DELETE FROM employees;

That would delete every row in the table.

Missing a WHERE clause is one of the most common and costly beginner mistakes in SQL.

Safe workflow before changing data

A smart habit is to preview the rows first with a SELECT query using the same filter you plan to use in your UPDATE or DELETE.

SELECT *
FROM employees
WHERE employee_id = 2;

If that preview shows the exact row you want, then you can safely move on to:

UPDATE employees
SET city = 'Austin'
WHERE employee_id = 2;
Step 1: Write the WHERE clause.
Step 2: Test it with SELECT.
Step 3: Use the same filter in UPDATE or DELETE.
Step 4: Run the change only after the preview looks right.
Beginner rule: SELECT first, change second.

Common mistakes

  • Forgetting the WHERE clause in an UPDATE
  • Forgetting the WHERE clause in a DELETE
  • Inserting values in the wrong column order
  • Trying to insert a duplicate primary key value
  • Updating more rows than intended because the filter was too broad
  • Deleting a row when you really only meant to change one column
The most dangerous beginner mindset is “this query looks about right.” With data-changing commands, “about right” is not good enough.

Practice questions

1. Insert a new employee named Evan in Sales with a salary of 59000 in Austin.
2. Update Ana’s city to Denver.
3. Raise Ben’s salary to 80000.
4. Delete the employee with employee_id = 3.
5. Write the SELECT query you would run first before updating a row.

Bottom line

INSERT adds rows. UPDATE changes rows. DELETE removes rows.

These commands are core SQL skills, but they should always be used carefully because they change the real data in your tables.

Quick memory trick: INSERT = add, UPDATE = change, DELETE = remove.

Related SQL tutorials

SQL Hub
Start here for all SQL topics and tutorials.
SELECT Statement
Learn how to read data before you start changing it.
WHERE Clause
Understand how filtering works before using UPDATE or DELETE safely.
SQL Exercises
Practice beginner-friendly SQL problems across common query patterns.