Very nice! Now you will learn another trick for updating table records.
If you need to update several columns' values, you don't have to assign values to each column in separate statements. PostgreSQL gives us a short version. Look at the query below:
(first_name, middle_name, last_name) =
('Tom', 'Edwin', 'Jackson')
WHERE id = 1;
This query changes name data of the student with the
id = 1 to Tom Edwin Jackson. Of course, you can write this statement once for each updated column (e.g.
SET first_name = 'Tom', middle_name = 'Edwin', ..., etc.). But PostgreSQL allows us to use one
SET statement with a list of column names in parentheses
(first_name, middle_name, last_name), the
=, and a list of new values
('Tom', 'Edwin', 'Jackson').