Now let's see how to update data using **SQLModel**.
## Continue From Previous Code
As before, we'll continue from where we left off with the previous code.
<details>
<summary>👀 Full file preview</summary>
```Python
{!./docs_src/tutorial/where/tutorial006.py!}
```
</details>
Remember to remove the `database.db` file before running the examples to get the same results.
## Update with SQL
Let's quickly check how to update data with SQL:
```SQL hl_lines="1-2"
UPDATE hero
SET age=16
WHERE name = "Spider-Boy"
```
This means, more or less:
> Hey SQL database 👋, I want to `UPDATE` the table called `hero`.
>
> Please `SET` the value of the `age` column to `16`...
>
> ...for each of the rows `WHERE` the value of the column `name` is equal to `"Spider-Boy"`.
In a similar way to `SELECT` statements, the first part defines the columns to work with: what are the columns that have to be updated and to which value. The rest of the columns stay as they were.
And the second part, with the `WHERE`, defines to which rows it should apply that update.
Notice that in the `UPDATE` the single equals sign (`=`) means **assignment**, setting a column to some value.
And in the `WHERE` the same single equals sign (`=`) is used for **comparison** between two values, to find rows that match.
This is in contrast to Python and most programming languages, where a single equals sign (`=`) is used for assignment, and two equal signs (`==`) are used for comparisons.
It will also save anything else that was added to the session.
For example, if you were also creating new heroes and had added those objects to the session before, they would now be saved too in this single commit.
This commit will generate this output:
<divclass="termy">
```console
$ python app.py
// Some boilerplate output omitted 😉
// Previous output omitted 🙈
// The SQL to update the hero in the database
INFO Engine UPDATE hero SET age=? WHERE hero.id = ?
INFO Engine [generated in 0.00017s] (16, 2)
INFO Engine COMMIT
```
</div>
## Refresh the Object
At this point, the hero is updated in the database and it has the new data saved there.
The data in the object would be automatically refreshed if we accessed an attribute, like `hero.name`.
But in this example we are not accessing any attribute, we will only print the object. And we also want to be explicit, so we will `.refresh()` the object directly: