UPDATE changes field values in a table. You can use it to make a simple, global change to that field, or use it with WHERE to make the change to every row in the table that has a matching value.
Simple UPDATE
Use UPDATE to set the value of a particular field:
1 SQL> update staging.order_item
set customer_name = ‘Acme Inc.’;

Check your change by retrieving that field from the table:
1 SQL> select customer_name, count(*) from staging.order_item;

Use UPDATE to Make Global Edits
To change all fields that contain the same value to a new value, use UPDATE with WHERE.
In our first example, we’ll do a simple update by setting the batch_name variable:
1 SQL> update staging.order_item
set batch_name = ‘TriggersOrdersBatches’;

Check your update by retrieving that field from the table:
1 SQL> select batch_name, count(*) from staging.order_item;

Now let’s try a more complicated example and make a batch edit. We’ll update all items where product_name is null to ‘UNKNOWN’:
1 SQL> update staging.order_item
set product_name = ‘UNKNOWN’
where product_name is null;

