Updating table data
As discussed in Chapter 2, Creating Tables with a Solid Structure, table updating is one of the four operations in the CRUD data lifecycle. Updating can be done either in-place (that is, modifying the data in the original row) or outside (that is, deleting the old row and inserting the new row). To update the values of the data presented in a table in-place, you can use the UPDATE statement:
UPDATE {table_name} SET
{column_1} = {column_value_1},
{column_2} = {column_value_2},
…
WHERE {conditional};
Here, {table_name} is the name of the table with data that will be changed, {column_1}, {column_2}, … is the list of columns whose values you want to change, {column_value_1}, {column_value_2}, … is the list of new values you want to update into those columns, and WHERE is a conditional statement like the one you would find in a SELECT query. For the rows that meet the condition of the WHERE clause in...