Check sibling questions
Computer Science - Class 12
Solutions to CBSE Sample Paper - Computer Science Class 12

To establish a connection between Python and SQL database, connect() is used. Which of the following arguments may not necessarily be given while calling connect() ?

(a) host

(b) database

(c) user

(d) password



To create a connection between the MySQL database and python application, the connect( ) function is used. The functions requires 4 parameters:

  • Hostname
  • Username
  • Password 
  • Database name

Among the 4 parameters, database name is not a mandatory parameter.


So, the correct answer is (b) database.

Learn in your speed, with individual attention - Teachoo Maths 1-on-1 Class

Ask a doubt
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 13 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.