A database update changes values already stored in a table. Think of it like correcting cells in a spreadsheet: the row stays in place, but one or more values change. An UPDATE statement names the table, SET assigns replacement values, and WHERE identifies the rows to change. section 17.1.2
Change one title’s price
To reduce the price of Pride and Predicates, update the title table, set Price to 8.95, and filter for its title name. The WHERE condition is crucial: without it, every row in title would receive the new price. section 17.1.2
UPDATE title SET Price = 8.95 WHERE TitleName = 'Pride and Predicates';
This complete statement follows the practical order: choose the table, set a value, then limit the affected row. section 17.1.2
An UPDATE can handle several nearby tasks:
- Set several columns at once by separating assignments with commas; all changed columns belong to the same table and meet the same filter condition. section 17.1.3
- Use a key or other unique identifier, such as TitleID, to target the precise intended row or rows. section 17.1.3
- Set a nullable column to NULL when the value should be absent rather than replaced with another value. section 17.1.3
- Populate a newly added column in existing rows, using WHERE and IN to assign values to selected groups. section 18.2.1
For a change based on related tables, UPDATE still changes only one table, but a join can supply the filtering logic. The exact multitable UPDATE syntax differs among database products, so confirm the form supported by the RDBMS in use. section 17.1.4
Treat updates as permanent, real-time changes. Before running one, execute a SELECT with the same filtering logic and inspect the rows it returns. This preview helps catch a missing WHERE clause or incorrect predicate before data is changed. section 17.3 section 17.1.1
Correct a customer address
After adding a customer, update Address, City, State, and Zip together, filtering with CustomerID = 22. This is a realistic use of a unique identifier to change one customer record. section 17.5


