CBSE Class 12 Computer Science Question 30 of 46

Interface Python with MySQL — Question 7

Back to all questions
7
Question

Question 7

To fetch one record from the resultset, you may use <cursor>. ............... method.

  1. fetch()
  2. fetchone()
  3. fetchtuple()
  4. none of these
Answer

fetchone()

Reason — The <cursor>.fetchone() method will return only one row from the resultset in the form of a tuple containing a record.