Import Excel to PostgreSQL with Python 🍰

Learn how to import Excel files into PostgreSQL using Python with a real bakery sales dataset. Beginner-friendly guide!

Import Excel to PostgreSQL with Python 🍰
Data Geek is my name
611 views β€’ Jun 3, 2025
Import Excel to PostgreSQL with Python 🍰

About this video

Learn how to import Excel files into a PostgreSQL database using Python in this beginner-friendly tutorial!
In this video, we use a real-world bakery sales dataset and walk you through the entire process step-by-stepβ€”from reading Excel with pandas, connecting to PostgreSQL with psycopg2, and inserting data into a SQL table.
Whether you're a data analyst, student, or developer, this workflow will help you automate your data pipeline and master real-world database tasks.

*If you're using Anaconda like I am, and you get an error for psycopg2, just run this* :
pip install psycopg2-binary

πŸ”Ή *Tools used* :
βœ”οΈ Jupyter Notebook (Anaconda)
βœ”οΈ PostgreSQL (pgAdmin)
βœ”οΈ pandas + psycopg2 libraries

πŸ”Ή *What you'll learn* :
βœ”οΈ How to read Excel files with pandas
βœ”οΈ How to connect Python to PostgreSQL
βœ”οΈ How to insert Excel rows into SQL using Python
βœ”οΈ Tips to clean and convert your data
βœ”οΈ Real-world use cases with bakery sales data

πŸ”— GitHub Files & Notebook: https://github.com/data-geek-lab/excel-postgres-python
πŸ‘‰ Subscribe: https://www.youtube.com/@datageekismyname
β˜• Support my channel: Buy me a coffee:
https://www.youtube.com/@datageekismyname
Or
*Donate on paypay*:
https://www.paypal.com/donate/?hosted_button_id=ZCL24X55R9C5G

πŸ’¬ Drop your questions or project ideas in the comments. I read and reply to all!

*How to download Anaconda to use Jupyter Notebook for Python coding:* https://youtu.be/ImhtTEfQafo?si=5yxLQ4gAe8AqbtYm

*How to download Postgresql: https://youtu.be/IcJvVUln-KY?si=5s-YIZugq1Xnn82v

===== *Continue your learning* ========
Get the Data Analytics Kickstart eBookβ€”your all-in-one beginner guide to Python, SQL & Power BI.
Includes real-world examples, cheat sheets, 3 real-world data project ideas, and video walkthroughs! -- https://www.datageekismyname.com/ebook

#python #postgresql #exceltosql #dataautomation #dataanalytics #learnsql #psycopg2 #jupyternotebook

⏳ *Timestamps* ⏳
00:00 Intro
0:56 Reviewing the dataset in excel
01:29 Open PgAdmin to create a your database in postgresql
02:40 Open Jupyter Notebook to create python code
03:10 Step 1: Import libraries
03:36: How to load the excel file dataset into Jupyter Notebook
04:56 Step 2. Load the excel data
06:29 Step 3. Connect to Postgresql database
08:37 Step 4. Create a table PostgreSQL (run this only once)
12:55 Step 5. Prepare the
19:20 Close connection (good practice to always close SQL connection)
19:46 Outro (Thank you for watching I hope this tutorial helps.)

Disclaimer: This content is for educational purposes only. Affiliate links may be included, and I may earn a small commission at no extra cost to you. Thank you for supporting the channel!

Tags and Topics

Browse our collection to discover more content in these categories.

Video Information

Views

611

Likes

15

Duration

20:07

Published

Jun 3, 2025

Related Trending Topics

LIVE TRENDS

Related trending topics. Click any trend to explore more videos.