SQL INSERT, UPDATE and DELETE
INSERT adds rows, UPDATE changes them and DELETE removes them. UPDATE and DELETE without WHERE affect every row in the table, so always write the WHERE first.
How do you add rows?
INSERT INTO customers (name, country)VALUES ('Ana', 'AT'), ('Ben', 'DE');
Name the columns, so the query still works if the table gets a new column.
How do you change rows?
UPDATE ordersSET status = 'shipped'WHERE id = 1042;
How do you remove rows?
DELETE FROM ordersWHERE status = 'test';
How do you avoid accidents?
Run the same WHERE as a SELECT first and check the count: SELECT COUNT(*) FROM orders WHERE status = 'test';. In a real database, work inside a transaction (BEGIN … COMMIT) so you can ROLLBACK a mistake.
Will a data analyst need this?
Less often than SELECT, since analysts mostly read data. But interviews ask about it, and you need it for your own tables, staging data and fixing test rows.
Practise INSERT Practise UPDATE Practise DELETE
Updated November 2026.