the db-api rollback(used to rollback all the changes made to the database since the last transaction commit (optional as not all databases provide transaction supportcursor(returns new cursor object to use with the connection the cursor object the cursor object is returned from the connection cusor(method cursor object represents database cursorwhich is used to manage the context of fetch operation or the execution of database command cursors support variety of attributes and methodscursor execute(operationparametersprepare and execute database operation (such as query statement or an update commandparameters may be provided as sequence or mapping and will be bound to variables in the operation variables are specified in database-specific notation cursor rowcount read-only attribute providing the number of rows that the last cursor execute(call returned (for select style statementsor affected (for update or insert style statementscursor description read only attribute providing information on the columns present in any results returned from select operation cursor close(closes the cursor from this point on the cursor will not be usable in additionthe cursor object also provides several fetch style methods these methods are used to return the results of database query the data returned is made up of sequence of sequences (such as tuple of tupleswhere each inner sequence represents single row returned by the select statement the fetch methods defined by the standard arecursor fetchone(fetch the next row of query result setreturning single sequenceor none when no more data is available cursor fetchall(fetch all (remainingrows of query resultreturning them as sequence of sequences cursor fetchman(sizefetch the next set of rows of query resultreturning sequence of sequences ( tuple of tuplesan empty sequence is returned when no more rows are available the number of rows to fetch per call is specified by the parameter