Q. If query is a string storing an SQL statement. Write statements so that the data is fetched based on query from SQL database Mydata.


Answer =



import mysql.connector as a
db = a.connect(user = 'root', passwd = '0000000000', host = 'localhost', database = 'company')
import pandas as pd
df = pd.read_sql (f'select * from sales where sales>50000', db)
print(df)


Post a Comment

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

Previous Post Next Post