Skip to content
Justice Tech School

UPDATE with WHERE

Without WHERE an UPDATE changes every row. Always check WHERE first.

Example
UPDATE courses SET price = price + 1000 WHERE level = 'Beginner';
SELECT title, price FROM courses;

Result

title         | price
Intro to HTML | 1000
CSS Basics    | 6000
JavaScript    | 15000
Python        | 13000
SQL           | 9000

Exercise

Set a column.

UPDATE courses  price = 1

Quiz Test

What if UPDATE has no WHERE?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.