SQL (SQLite engine)

Verify an update changed the right fields

Easy30 pts~12 min
  • UPDATE verification
  • Side effects
  • Regression checks
Practice app · Acme Commerce DB

A real SQL database (SQLite engine) seeded with an e-commerce and HR dataset, with schema browser and query runner.

Test URL
/lab/database-testing-verify-an-update-changed-the-right-fields

Your starter code already declares TEST_URL — never hardcode a host.

Objective

Apply a price and stock correction to one product and prove that only the intended fields of the intended row changed.

Your task

  1. 1Update product id 3 (Echo Studio Earbuds): set price to 119 and stock to 70.
  2. 2Scope the UPDATE with WHERE id = 3 so no other product is touched.
  3. 3Verify the row: SELECT id, sku, name, price, stock, is_active FROM products WHERE id = 3.
  4. 4Optionally compare the rest of the table against a pre-update snapshot to prove nothing else moved.

Acceptance criteria

  • Only product 3's price and stock changed; every other product is untouched
  • The last result set is product 3 after the update
  • The UPDATE has a WHERE clause

Constraints

  • Every run starts from a freshly seeded database, so your script must include its own setup statements.
  • Only the last result set of your script is compared, so finish with the verification query.

SQL (SQLite engine) · Database Testing · Data validation basics