to work on other database systems parameters to substitute into the sql statement string are generally passed in as sequence ( list or tuplenotice the module' paramstyle--this tells us what style it uses for substitution targets in the statement string hereqmark means this module accepts for replacement targets other database modules might use styles such as format (meaning % target)or numeric indexes or mapping keyssee the db api for more details to insert multiple rows with single statementuse the executemany method and sequence of row sequences ( list of liststhis call is like calling execute once for each row sequence in the argumentand in fact may be implemented as suchdatabase interfaces may also use database-specific techniques to make this run quickerthoughcurs executemany('insert into people values (???)'('sue''mus'' ')('ann''mus'' ')]curs rowcount we inserted two rows at once in the last statement it' hardly any more work to achieve the same result by inserting one row at time with python looprows [['tom''mgr' ]['kim''adm' ]['pat''dev' ]for row in rowscurs execute('insert into people values (??)'rowconn commit(blending python and sql like this starts to open up all sorts of interesting possibilities notice the last commandwe always need to call the connection' commit method to write our changes out to the database otherwisewhen the connection is closedour changes may be lost in factuntil we call the commit methodnone of our inserts may be visible from other database connections technicallythe api suggests that connection object should automatically call its rollback method to back out changes that have not yet been committedwhen it is closed (which happens manually when its close method is calledor automatically when the connection object is about to be garbage collectedfor database systems that don' support transaction commit and rollback operationsthese calls may do nothing sqlite implements both the commit and rollback methodsthe latter rolls back any changes made since the last commit sql database interfaces