| Lesson 5 || Using UPDATE |
| Objective || Modify existing records using the UPDATE statement. |
Modify existing Records using the UPDATE statement
Data in the VirtualBookShelf.com Web site will change on a frequent basis. New customers will be added while others will become inactive or customer information will need to be changed if a customer moves.
Book inventory information will change as the inventory fluctuates or when a book status changes from the regular price to sale price.
UPDATE statement is used to modify rows in a table. A single
UPDATE statement can modify all rows in a table or only selected rows.
Clauses used with
statement uses clauses to specify columns and rows. These
SET: allows you to update single or multiple columns
WHERE: allows you to update specific rows just as with the
The following SlideShow describes how to construct the
statement syntax using the
UPDATE Statement Syntax
SQL also lets you explicitly set values with a literal, such as Qty = 5. This might be used if you want to initialize columns in new rows to an initial value, or reset columns to a specific value. In the next lesson, the addition of rows to a table will be discussed.