As already stated in the comments by @yotheguitou you have to commit to save the changes made to your SQLite since the last commit.
After you executed a DELETE
statement you need to call connection.commit()
.
cursor.execute("DELETE FROM ticket WHERE ROWID = (SELECT MAX(ROWID) FROM ticket)")
connection.commit()
If you want to automatically commit after any executed statement, set isolation_level=None
.
conn = sqlite3.connect("example.db", isolation_level=None)