The method cursor() is used in Python-MySQL connectivity applications. This…
2023
The method cursor() is used in Python-MySQL connectivity applications. This method is a member of: Python-MySQL
- A.
sql module / sql module
- B.
pickle module / pickle module
- C.
database-connectivity module / database-connectivity module
- D.
csv module / csv module
Attempted by 1180 students.
Show answer & explanation
Correct answer: C
The method cursor() is used when Python connects to MySQL. It allows us to create a cursor object, which is used to execute SQL queries. This method is part of modules that handle database connectivity , such as mysql.connector , pymysql , etc. Let’s check the options: A: sql module → Incorrect, because Python does not have a built-in SQL module for MySQL connections.
B: pickle module → Incorrect, used for object serialization, not databases.
C: database-connectivity module → Correct , because cursor() belongs to modules used for connecting and interacting with databases.
D: csv module → Incorrect, used for CSV file operations, not database connectivity.
Correct Answer: C — database-connectivity module