Computer Science
Assertion. The cursor rowcount returns how many rows have been retrieved so far through fetch…() methods.
Reason. The number of rows in a resultset and the rowcount are always equal.
Python MySQL
1 Like
Answer
(c)
Assertion is true but Reason is false.
Explanation
The cursor.rowcount returns how many rows have been so far retrieved through fetch…() methods from the cursor. However, the number of rows in a result set and the rowcount may not always be equal. This is because the rowcount attribute of the cursor only reflects the number of rows fetched by the fetch…() methods, not necessarily the total number of rows in the entire result set.
Answered By
2 Likes
Related Questions
Assertion. The database cursor and resultset have the same data yet they are different.
Reason. The database cursor is a control structure and the resultset is a logical set of records.
Assertion. One by one the records can be fetched from the database directly through the database connection.
Reason. The database query results into a set of records known as the resultset.
What are the steps to connect to a database from within a Python application ?
Write code to connect to a MySQL database namely School and then fetch all those records from table Student where grade is ' A' .