Check sibling questions

Which method of cursor class is used to fetch limited rows from the table?

(A) cursor.fetchsize(SIZE)

(B) cursor.fetchmany(SIZE)

(C) cursor.fetchall(SIZE)

(D) cursor.fetchonly(SIZE)

 

Answer:

Checking the options

  • (A) cursor.fetchsize(SIZE) - It is not a method of cursor class.
  • (B) cursor.fetchmany(SIZE) - It returns the number of rows specified by the size argument.
  • (C) cursor.fetchall(SIZE) - It returns all the rows of a query result.   
  • (D) cursor.fetchonly(SIZE) - It is not a method of cursor class.

 

From the options given above, the function cursor.fetchmany(SIZE) is used to fetch limited rows from the table.

So, the correct answer is (B)

Are ads bothering you?

Davneet Singh's photo - Teacher, Engineer, Marketer

Made by

Davneet Singh

Davneet Singh is a graduate from Indian Institute of Technology, Kanpur. He has been teaching from the past 12 years. He provides courses for Maths and Science at Teachoo.