rows changed (for dml changesor fetched (for dql queries)and the cursor' description attribute gives column names and types after queryexecute also returns the number of rows affected or fetched in the most vendor interfaces for dql query statementsyou must call one of the fetch methods to complete the operationtuple cursobj fetchone(listoftuple cursobj fetchmany([size]listoftuple cursobj fetchall(fetch next row of query result fetch next set of rows of query result fetch all remaining rows of the result and once you've received fetch method resultstable information is processed using normal python sequence operationsfor exampleyou can step through the tuples in fetchall result list with simple for loop or comprehension expression most python database interfaces also allow you to provide values to be passed to sql statement stringsby providing targets and tuple of parameters for instancequery 'select nameshoesize from spam where job and age ?cursobj execute(query(value value )results cursobj fetchall(for row in resultsin this eventthe database interface utilizes prepared statements (an optimization and convenienceand correctly passes the parameters to the database regardless of their python types the notation used to code targets in the query string may vary in some database interfaces ( : and : or two %srather than the two ? used by the oracle interface)in any eventthis is not the same as python' string formatting operatoras it sidesteps security issues along the way finallyif your database supports stored proceduresyou can call them with the call proc method or by passing an sql call or exec statement string to the execute method callproc may generate result table retrieved with fetch variantand returns modified copy of the input sequence--input parameters are left untouchedand output and input/output parameters are replaced with possibly new values additional api featuresincluding support for database blobs (roughlywith sized results)is described in the api' documentation for nowlet' move on to do some real sql processing in python an sql database api tutorial with sqlite we don' have space to provide an exhaustive reference for the database api in this book to sample the flavor of the interfacethoughlet' step through few simple examples we'll use the sqlite database system for this tutorial sqlite is standard part of python itselfwhich you can reasonably expect to be available in all python installations although sqlite implements complete relational database systemit takes the form of an in-process library instead of server this generally makes it better suited for program storage than for enterprise-level data needs databases and persistence