CBSE Class 12 Informatics Practices Question 4 of 70

Importing/Exporting Data between CSV Files/MySQL and Pandas — Question 4

Back to all questions
4
Question

Question 4

Assertion. The read_sql() function of Pandas can query upon any mysql database.

Reason. The read_sql() function can query upon only those databases that have a connection established through mysql database connector.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.
Answer

A is false but R is true.

Explanation
The read_sql() function is capable of querying data from MySQL databases, it is limited to databases for which a connection has been established through a MySQL database connector. Without this connection, the read_sql() function cannot query data from the MySQL database.