SQL · Writing data

update

Changes matching rows. Always include a precise WHERE clause and check the affected count.

Syntax
update table set col = value where …;

Example

Open in the lab

More in this group

delete insert insert from select insert returning merge truncate update from upsert

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course