Pandas read_sql_query() is an inbuilt function that read SQL query into a DataFrame. The read_sql_query() function returns a DataFrame corresponding to the result set of the query string. Optionally provide an index_col parameter to use one of the columns as the index; otherwise, the default integer index will be used.
If you don’t know how to connect Python with MySQL, then check out how to connect Python with MySQL guide. In that tutorial, I have briefly described which module you need to use in Python3 to connect MySQL server and fetch the data from the Database.
#python #pandas