Q. Consider following code when conn is the name of established connection to MySQL database.


Cars = {‘Brand’: [‘Alto’, 'Zen', 'City', 'Kia'], 'Price': [22000, 25000, 27000, 35000]}


df = DataFrame (Cars, columns = ['Brand', 'Price'])

df.to_sql ('CARS', conn, if_exists = 'replace', index = False)


What will be the output of following query if executed on MySQL :


SELECT * from CARS;


Answer =

Output of: - select * from cars;


+-------+-------+
| brand | Price |
+-------+-------+
| Alto  | 22000 |
| zen   | 25000 |
| city  | 27000 |
| kia   | 35000 |
+-------+-------+

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post