Skip to content
skillbld
Day 5 of 14 30 minUPDATEDELETERETURNING

Keep data current. Update and delete rows safely, see what changed with RETURNING, use a transaction as a safety net, and insert-or-update with ON CONFLICT.

By the end of today you can

  • Change rows with UPDATE … SET … WHERE
  • Remove rows with DELETE … WHERE
  • See affected rows with RETURNING
  • Wrap risky changes in BEGIN / ROLLBACK / COMMIT
  • Insert or update in one statement with ON CONFLICT

What's inside

  • 4 sections
  • 3 diagrams and mind maps
  • 5 code examples you can run
  • 4-question quiz
  1. 1UPDATE: change existing rows
  2. 2DELETE: remove rows
  3. 3Transactions: your safety net
  4. 4Upsert: insert or update

Sign in free to read this lesson

Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.

Sign in free
Day 5: Changing Data · PostgreSQL · SkillBld