Sometimes you will need to update a certain column value of an entry in your database. This is rather easy in the context of SQLAlchemy ORM and is done in the same way you would change Python object’s attribute.

The commands below change the email of a reader with id=3 and commit the changes to the database:

reader = Reader.query.get(3) reader.email = “[email protected]” db.session.commit()

If you want to undo the update, you can use


instead of committing.



Using the get method, fetch a book entry with id = 19 and assign it to the variable called book_19.


Change the month attribute of book_19 to June.


Commit the change.

Sign up to start coding

Already have an account?