The project imports an Excel file into MySQL using Python Pandas. It then Separates the Spreadsheet programmatically into 2 separate worksheets into Sheet1]: Identified as Authentication and the Sheet2]: Employee Records.
- You have to be familiar with Python pandas and writing SQL queries to execute the project.
- from sqlalchemy import create_engine
- import pymysql
- import pandas as pd
- mycursor = mydb.cursor()
- mycursor.execute("CREATE DATABASE A_100recordsDB")
- df= pd.read_excel("C:\Users\user\Desktop\python-files\100 Records2.xlsx")
- engine = create_engine("mysql+pymysql://{user}:{pw}@{host}/{db}" * .format(host=hostname, db=dbname, user=uname, pw=pwd))
-
df.to_sql('the_100_records_tbl2', engine, index=False)
-
df = pd.read_sql_query("SELECT * FROM the_100_records_tbl2", engine)