QuestionQ2

VerifiedFile Processing and Communicating with a Program’s Environment

What is the outcome of the following code, assuming the SELECT query returns three records?

Question Image

Explanation

fetchall() returns all remaining rows from a cursor’s result set. The first call consumes the three selected records, leaving no rows for the second call; consequently, rows is an empty list.

Community Discussion

No comments yet. Be the first to start the discussion!