import sqlite3 with sqlite3.connect("db1.sqlite3") as conn: cur=conn.cursor() sql="select * from student" cur.execute(sql) r=cur.fetchone() while r!=None: print(r) r=cur.fetchone()
B.
import sqlite3 with sqlite3.connect("db1.sqlite3") as conn: cur=conn.cursor() sql="select * from student" cur.execute(sql) r=cur.fetchall() for item in r: print(item)
C.
import sqlite3 with sqlite3.connect("db1.sqlite3") as conn: cur=conn.cursor() sql="select * from student" cur.execute(sql) r=cur.fetchmany(-1) for item in r: print(item)
D.
import sqlite3 with sqlite3.connect("db1.sqlite3") as conn: cur=conn.cursor() sql="select * from student" cur.execute(sql) r=cur.fetchmany(1:-1) for item in r: print(item)