Chapter 16 discussed inserting new rows of data into tables and contained our first exercises for doing something with SQL other than reading data. The chapter also briefly mentioned that the INSERT keyword is one of several used for data manipulation.
This chapter examines two other ways of manipulating data: updating and deleting. Because SQL is designed to be intuitive for English speakers, we’ll work with the keywords UPDATE and DELETE, respectively.
17.1 Updating values
Updating data is a bit different from inserting data, in that we’re manipulating data at the column level instead of the row level. Recall that tables have rows, and rows have properties represented by columns. When we update data in SQL, we’re updating the values of those properties, so we’re making changes at the column level.
These changes may or may not include all columns in a given row, and they may or may not involve updating the values of one or more columns of every row in the table. The point is that we have many options for updating data in SQL. If this discussion is confusing, some examples may help you understand the options.