Learn SQL fundamentals using DuckDB and Python. A practical series for Python developers who want to level up their data skills.
SQL is the language of data — and if you work in Python, learning it will make you better at nearly everything you already do. This series walks you through SQL from first principles using DuckDB, a modern, local database that runs inside Python with no server setup required. No credentials, no Docker, no configuration. Just Python and data.
Each post builds on the last. By the end you’ll be writing queries, filtering and aggregating data, joining related tables, and using advanced features like CTEs and subqueries — all explained from a Python developer’s perspective.
Last week, we got DuckDB running with three hardcoded rows. That got us started, but three rows? You can eyeball that. Let’s generate hundreds of realistic customers and build a dataset worth exploring.
Python has the perfect tool: faker. It’s a library that generates realistic fake data: names, emails, addresses, dates, and anything else you’d find in a real database. Let’s use it to build a dataset we can explore for the rest of this series.
...
Zero-Setup SQL: Run your first SQL query in under 5 minutes with DuckDB
Have you ever tried setting up a database server just to learn SQL? Docker containers, admin credentials… Forget all that. Let me show you how to go from zero to running SQL in under 5 minutes.
Why are we using DuckDB to learn SQL? No setup - Just import and start using it Real SQL - PostgreSQL compatible syntax so what you learn transfers Fast enough - Handles millions of rows on your laptop Python-native - Works well with lists, DataFrames, CSV files It is perfect for learning without infrastructure headaches.
...
I know Python; Why learn SQL
I learned SQL very early in my career. At the time, I didn’t understand why, and for the first month or so, it didn’t make sense to me. The syntax didn’t resemble any language I had seen before, and it employed concepts with which I was unfamiliar. This all made SQL seem scary, and oddly enough, SQL hasn’t changed much in the past 40 years, which makes it even more of an oddity.
...