cursor.execute('SELECT foo, bar, baz, quux FROM table WHERE id = %s;', (
    interesting_record_id,))
for foo, bar, baz, quux in cursor.fetchall():
    frobnicate(foo + bar, baz * quux)
How can I reference columns by their names in python calling SQLite?