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)

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.