Question 1

Which data type is mostly returned by fetchall() method in Python-MySQL connectivity?

Which data type is mostly returned by fetchall() method in Python-MySQL connectivity? Select the most common answer
  1. AA single list or an empty list, if no more rows are available.
  2. BA list of tuples or an empty list, if no more rows are available.
  3. CA list of dictionaries or an empty list, if no more rows are available.
  4. DA single tuples or an empty tuple, if no more rows are available.
Show answerHide answer

Correct answer: (B) A list of tuples or an empty list, if no more rows are available.

Explanation

cursor.fetchall() returns the remaining rows as a list of tuples (one tuple per row), or an empty list if no rows are left.

From DSSSB TGT Computer Science Practice Set 2

This is question 1 of DSSSB TGT Computer Science Practice Set 2. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.