Learn with Abdou

Chapter 9 · Concept 3 of 6 · Practice

Change only what you meant

UPDATE ... SET ... WHERE, and changes() · level 1 of 6

Opening your saved work…

Sign in to save across devices → · Download your guest work before switching accounts.

Change only what you meant · UPDATE ... SET ... WHERE, and changes() · level 1 of 6

One price, one row

Level 1: Watch it answered · Exercise 1 of 1

The Medium House Blend Coffee (id 1) goes from 3.50 to 3.75. Watch the statement, run it, and look at the row.

Data: Northshore Coffee. Every run starts from a fresh copy, so nothing you try here is permanent.

Why it works, clause by clause

  1. UPDATE menu_items: the table.
  2. SET price = 3.75: the column and its new value.
  3. WHERE id = 1: the one row. The id is the safest WHERE there is.

From the reading: Change only what you meant, paragraph 1

The queryOpening the database…
UPDATE menu_items
SET price = 3.75
WHERE id = 1;
Open in the playground

Query results

Run it to see the result here.

Run it to see the result here.

Practice here is evidence for you and your instructor, never a grade. Grades live in Canvas.