Check out example codes for "how to connect mysql database in jupyter notebook". It will help you in understanding the concepts better.

Code Example 1

# %%
%load_ext sql

# %%
%sql mysql+mysqldb://<user>:<password>@localhost/<dataBase>

# %%
%%sql

SELECT *
FROM <table>;

Learn ReactJs, React Native from akashmittal.com