The UPDATE command is a DML command as opposed to a DDL (Data Definition Language), DCL (Data Control Language), or TCL (Transaction Control Language) command. This means that it is used for modifying preexisting data. Other DML commands include: SELECT, INSERT, DELETE, etc.
UPDATE takes a table and uses the SET keyword to control what row to change and what value to set it to. The WHERE keyword checks a condition and, if true, the SET portion is run and that row is set to the new value. If false, it is not set to the new value.
Update can be used for a lot of different problems. For example:
To add 1 to every value in a column you can run:
Takes the values in a column and adds 1 to them.
To set every value to a random integer on the interval [1,10]:
Generates a random double precision (float8) type number from [0,1), multiplies it by 9, and adds 1 to that value and casts it to an integer type for each row.
To set values to 0 for even 1 for odd:
Uses MOD to set the column values to the remainder of the column values divided by 2.