CBSE Class 12 Computer Science Question 16 of 47

Interface Python with SQL — Question 6

Back to all questions
6
Question

Question 6

To execute all the rows from the result set, which method is used?

  1. fetchall()
  2. fetchone()
  3. fetchmany()
  4. none of these
Answer

fetchall()

Reason — The fetchall() method retrieves all the rows in a result set and returns them as a list of tuples.