Converting Excel data to SQL(PostgreSQL) Table in Python

Excel to SQL Tables

Introduction

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

Prerequisites

Check that you have all the required libraries.

Step1:

First load the excel sheet.

Step2:

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

Step3:

Create Engine in sqlalchemy

Data Analyst at Tata Power Ltd.