已知创建好的数据库db.sqlites,该数据库中已经创建了一张学生表student,并且已经录入学生的信息,要查询所有学生的信息,选择下列哪些选项是正确的。
A.
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)