Skip to content

Updating rows

Handout

Changing rows with UPDATE

UPDATE changes values in the rows that match a WHERE condition:

UPDATE product SET price = 0.95 WHERE code = 'P02';

SET lists the columns to change. You can change several at once, separated by commas: SET price = 0.95, in_stock = 150.

UPDATE with a WHERE changes only the matching row's cell

Handout

Log in or create account

IGCSE & A-Level