RANIARANIA Academy

Modifying Data — INSERT, UPDATE, DELETE & Transactions

Learn to change data safely in PostgreSQL — adding rows with INSERT, correcting them with UPDATE, removing them with DELETE and TRUNCATE, and merging with UPSERT. You will wrap risky changes in transactions with BEGIN, COMMIT, ROLLBACK and savepoints so every modification is deliberate and reversible.

Watch the free preview

INSERT basics — single and multiple rows — free to watch, no account needed.

PostgreSQL BEGINNER · 150 min · Certificate on completion · 3 CPD points

What you'll learn

  • Change data safely with INSERT, UPDATE and DELETE and reversible transactions
  • Insert single and multiple rows and capture generated values with RETURNING
  • Update and delete precisely using a WHERE clause, and clear tables with TRUNCATE
  • Merge rows idempotently with UPSERT using ON CONFLICT
  • Control transactions and partial rollbacks with BEGIN, COMMIT, ROLLBACK and savepoints

Syllabus

Adding Rows with INSERT
INSERT basics — single and multiple rowsFree preview15 min
RETURNING and inserting from a query15 min
Updating and Deleting Data
UPDATE with a WHERE clause15 min
DELETE and TRUNCATE15 min
Merging Data with UPSERT
ON CONFLICT DO NOTHING and DO UPDATE15 min
Bulk UPSERT and keeping imports idempotent15 min
Transactions and ACID
Transactions — BEGIN, COMMIT and ROLLBACK15 min
Savepoints and partial rollbacks15 min
Lab — 10 Exercises & Solutions
Exercises 1–515 min
Exercises 6–1015 min