In Python-MySQL connectivity, what is the primary purpose of a Cursor object?
2026
In Python-MySQL connectivity, what is the primary purpose of a Cursor object?
- A.
To store the password for the database connection.
- B.
To visually point to the data in the MySQL Workbench.
- C.
To execute SQL queries and fetch results from the database.
- D.
To act as a backup of the entire database.
Attempted by 127 students.
Show answer & explanation
Correct answer: C
In Python-MySQL connectivity, a Cursor object is primarily used to execute SQL statements and retrieve results from the database. It acts as an interface between Python code and the MySQL server, allowing for query execution and data fetching.