CBSE Class 12 Computer Science Question 29 of 46

Interface Python with MySQL — Question 6

Back to all questions
6
Question

Question 6

To obtain all the records retrieved, you may use <cursor>. ............... method.

  1. fetch()
  2. fetchmany()
  3. fetchall()
  4. fetchmultiple()
Answer

fetchall()

Reason — The <cursor>.fetchall() method will return all the rows from the resultset in the form of a tuple containing the records.