CBSE Class 12 Computer Science Question 12 of 47

Interface Python with SQL — Question 2

Back to all questions
2
Question

Question 2

To open a connector to MySQL database, which statement is used to connect with MySQL?

  1. connector
  2. connect
  3. password
  4. username
Answer

connect

Reason — The connect() function establishes a connection to the MySQL database from Python application and returns a MySQLConnection object, which we can then use to interact with the database.