Module 8 · Lesson 2 of 430/57 in the course~14 min
Module lessons (2/4)
Updating and Deleting: UPDATE and DELETE
Lesson preview5 hands-on exercises readySQL Course · Module 8 — Writing and Modifying Data
Targeted updates and deletes with WHERE — and how to avoid modifying whole tables.
What you'll learn in this lesson
- Edit existing rows with
UPDATE ... SET ... WHERE ...and delete them withDELETE FROM ... WHERE .... - Apply the "SELECT before modifying" security rule and inspect changes via
RETURNING. - Manage Foreign Key restrictions that prevent deletion of referenced parents.
Overview
UPDATE modify existing rows; DELETE removes them permanently. Both share one vital rule: the WHERE clause establishes which rows will be affected — omitting it instantly turns the change into an operation on the entire table, without any confirmation prompts.
View in the stepper how the WHERE clause strictly isolates the target row subset before each transformation:
Sections covered in this lesson
- 11. Mental Model: Control
WHERE,RETURNINGand Foreign Key - 22. Progressive & Annotated Examples
- 33. Interactive Laboratory: Why
WHEREComes Before Scripture - 44. Diagnostic Verification (Quiz)
- 55. Progressive Practical Laboratory
Pro Lesson · Module 8 — Writing and Modifying Data
Unlock "Updating and Deleting: UPDATE and DELETE" and the full SQL Course curriculum
Targeted updates and deletes with WHERE — and how to avoid modifying whole tables.
Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.
- Instant access to all advanced modules in SQL Course plus 17 more courses
- Hands-on browser exercises with automated test suites and solutions
- 14-day money-back guarantee processed via Paddle.com
14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.