Converting Excel data to SQL(PostgreSQL) Table in Python

Excel to SQL Tables


In the real world, data is mostly in the format of files i.e. Excel sheets. These excel sheets are not well structured and it contains multiple sheets, which is very complex to handle and hard to visualize (larger data) with using cross sheets with some complex conditions. SQL does this task very easily with schema structure and joins.

Steps to convert the Excel data to SQL Table


Check that you have all the required libraries.


First load the excel sheet.


Format the excel sheet so that columns contain the same datatypes and also handle the missing values.


Create Engine in sqlalchemy

Data Analyst at Tata Power Ltd.