query = (""" INSERT INTO person (id, name, country_id) VALUES (%(id)s, %(name)s, %(country[id])s) """) person = {'id': 1, 'name': 'First Last', 'country': {'id': 1, 'name': 'USA'}} cursor.execute(query, person) Is it possible to accomplish something like this for naming person['country']['id'] in the query string? Continue reading...