Example 1
Update one matching row
The WHERE clause is the safety boundary. Without it, the update would touch every row in the table.
Source table data Rows loaded before the example query runs.
Setup
CREATE TABLE users (id INT, status VARCHAR(20));
INSERT INTO
users (id, status)
VALUES
(1, 'pending'),
(2, 'active');Validated query Shared across supported engines.
SQL
UPDATE users
SET
status = 'active'
WHERE
id = 1;
SELECT
id,
status
FROM
users
ORDER BY
id;Expected result Returned rows for the shared example.
| id | status |
|---|---|
| 1 | active |
| 2 | active |
The verification output matches, but the execution blocks differ so the final captured table state stays deterministic.