06 Python 3 MySQL Database Access – Excel to MySQL



A practical application. Starts from Excel table. Saves as CSV. Python reads in the csv file and converts it to a multi-list. Imports the pymysql module. Connects to a localhost database. Creates a table called STUDENTS and assigns the column names based on the first row’s columns in the multi-list. Then deletes the first row in the list. Converts the list to String made up of the rows and replaces the square brackets with parenthesis. Inserts data into the database. Closes the database. — There is no one solution for this process, this is just one practical way of converting a limited excel sheet into a MySQL database.
———- Download the csv file below ————
* https://gist.github.com/drjonesy/d40e79aae06cee9209d19a8fdd6334e4