01Home 02Work With Me 03Speaking 04Research 05Teaching 06Students 07Products 08News 09Writing 10About 11Platform New 12Contact 13Curriculum Vitae
MBI802Video

UPDATE and DELETE

Change and remove rows with confidence. Short scrollable reels that show how to edit data without breaking everything around it.

Database Management Systems3 min readFree, no login
MBI802 · UPDATE and DELETE The first screen of UPDATE and DELETE

This is the written version of UPDATE and DELETE, taken from the lesson itself. The simulations, drag-and-drop activities and quizzes only work in the interactive lesson.

One missing WHERE clause and your whole table is gone. In this lesson you’ll watch the funny reels, run a live query simulator, and play “Safe or Sus?” so you never make that mistake.

Start here

Two statements, one little safety net

UPDATE changes rows; DELETE removes them. Both quietly hit every row in the table unless you add a WHERE clause to say which rows you mean. Here’s the difference at a glance.

AspectUPDATEDELETE
What it doesChanges values in rowsRemoves rows entirely
Needs WHERE?Yes — or every row changesYes — or every row is deleted
Keyword to set valuesSET column = value— (no SET)
Worst-case mistakeAll rows overwrittenWhole table emptied
Safety habitSELECT first, then UPDATESELECT first, then DELETE

Without WHERE

DELETE FROM students;
UPDATE students SET grade = 'F';

Hits every single row. Everyone fails. Everyone is deleted.

With WHERE

DELETE FROM students WHERE id = 3;
UPDATE students SET grade = 'F'
 WHERE id = 3;

Only the rows you target change. Precise, predictable, sane.

Try it · live simulator

Toggle the WHERE clause and watch

Pick UPDATE or DELETE, switch the WHERE clause on or off, then run it. See exactly what happens to the table — no real database is harmed.

  • Operation
  • WHERE clause
  • Target row (id)
  • Your query
UPDATE users
   SET status = 'banned'
 WHERE id = 3;
idnamestatus
1Aishaactive
2Benactive
3Chenactive
4Diegoactive
5Eshaactive

Watch · learn · laugh

SQL pain, turned into reels

Real mistakes everyone makes once, made funny. Tap a reel to play it right here — it stays on this page.

UPDATE gone wild.

The whole table is gone.

No backup, no problem? 😬

Always target your rows.

Reels load only when you press play, to keep the page fast on phones.

Keep them tame

Three habits that save your data

Do these every time and you’ll never empty a table by accident.

SELECT before you change

Run a SELECT with the same WHERE first. If it returns the rows you expect, swap SELECT for UPDATE or DELETE.

Beware WHERE 1=1

A condition that is always true affects every row — the same as having no WHERE at all.

Wrap it in a transaction

BEGIN, run your change, check it, then COMMIT if happy or ROLLBACK to undo. Your future self says thanks.

Check yourself

Safe or Sus?

Read each query and decide: would you really run it in production?

Would you run this in production?

DELETE FROM students;

Now try the real thing.

Everything above is on one page so you can read it anywhere. The lesson itself runs in your browser: no login, no install.