Check sibling questions

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

 

Answer:

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.

  1. Computer Science - Class 12
  2. Solutions to CBSE Sample Paper - Computer Science Class 12

About the Author

Davneet Singh

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