This repository is a structured learning path to master SQL using Python notebooks and DuckDB. The goal is to go from beginner to advanced level through progressive exercises and realistic datasets.
The purpose of this project is to develop strong SQL skills commonly used in data analytics and data science roles. By the end of this learning path, you should be able to:
- Write efficient SQL queries on single and multiple tables
- Perform data aggregation and transformation
- Work with joins and relational data models
- Use advanced SQL features such as CTEs and window functions
- Solve real-world data analysis problems
- Python
- DuckDB
- Pandas
- Jupyter Notebooks
The repository is organized into progressive modules:
00_setup/ Introduction to DuckDB and environment setup
01_basics/ Basic SQL queries (SELECT, WHERE, ORDER BY, LIMIT)
02_aggregations/ GROUP BY, aggregation functions, HAVING
03_joins/ INNER JOIN, LEFT JOIN, relational data queries
04_advanced_sql/ CASE WHEN, CTEs, subqueries
05_window_functions/ ROW_NUMBER, RANK, LAG, LEAD
06_case_studies/ Realistic business analysis projects
datasets/ Data generation scripts and data documentation
utils/ Helper functions for DuckDB and notebooks
pip install -r requirements.txt
jupyter notebook
Start with 00_setup and proceed in order. Each notebook builds on the previous one.
All datasets are generated using Python scripts located in the datasets/ folder. These datasets simulate real-world scenarios such as:
- E-commerce transactions
- Customer behavior
- Product catalogs
- Energy consumption data
The goal is to practice SQL on realistic and structured data.
Each notebook follows a consistent structure:
- Short theoretical introduction
- Dataset loading using Python and DuckDB
- Progressive SQL exercises
- Step-by-step explanations of solutions
- Basic SQL queries
- Aggregations and grouping
- Joins and relational data
- Advanced SQL concepts
- Window functions
- Case studies and applied analysis
By completing this repository, you should be able to independently analyze datasets using SQL and approach data problems with a structured analytical mindset similar to a data analyst or data scientist.
Personal project designed for learning SQL from scratch through practical exercises and real-world inspired datasets.