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 :

  1. A.

    sql module

  2. B.

    pickle module

  3. C.

    database-connectivity module

  4. D.

    csv module

Attempted by 1071 students.

Show answer & explanation

Correct answer: C

Explanation: The cursor() method is provided by database connectivity modules that follow the DB-API standard. It is a method of the connection object and returns a cursor object used to execute SQL queries and retrieve results from the database.

  • Examples: mysql.connector, pymysql

  • Typical usage: call conn.cursor() to obtain a cursor, then use cursor.execute(query) and cursor.fetchall() or cursor.fetchone() to get results.

Note: The cursor() method is not part of standard modules like sql, pickle, or csv. It is specific to database connectivity libraries.

Explore the full course: Rssb Senior Computer Instructor