Week 9 - SQL for Analytics
SQL for Analytics
Joins, CTEs, and Aggregations
Data Validation Queries
OLAP, OLTP & Warehouses
Data Modeling Concepts
Building SQL Views
Practice
Assignment
Gotchas & Pitfalls
Glossary
Career: SQL for Analytics
Going Further
Slides (PDF)
Going Further
This page is optional. Nothing here is required for Week 9's learning goals or the assignment.
Use it after you finish the week if you want to keep practicing SQL or dig deeper into data warehousing and dimensional modeling. The resources are grouped by how much time they take and how they relate to the week. Pick what interests you; do not try to work through all of it during the week itself.
Full courses and tutorials
Large structured resources that take hours to days to work through. Pick one if you want guided practice beyond this week's chapters.
- Mode SQL Tutorial: A free, hands-on SQL course that runs from basic SELECT through joins, aggregations, and window functions, with an in-browser editor. The "Intermediate SQL" section maps almost one-to-one onto this week's joins-and-aggregations chapter.
- PostgreSQL official tutorial: The canonical introduction to the exact database you use this week. Short, accurate, and the reference you should reach for when a Postgres-specific detail (like the
FILTER clause) trips you up.
- Select Star SQL: A free interactive book that teaches SQL by querying a real dataset, with exercises you answer directly in the page. Strong on the reasoning behind joins and aggregation rather than just syntax.
- DataTalks.Club Data Engineering Zoomcamp - Data Warehouse module: A free module covering OLAP warehouses, columnar storage, and partitioning on the same NYC taxi dataset you use this week. Uses BigQuery, but the concepts transfer directly to Snowflake or Databricks.
Deep dives on specific topics
Longer-form reading that goes beyond what the Week 9 chapters introduced.
- Use The Index, Luke!: A free web book on how SQL indexing and query performance actually work. Read it once your queries start feeling slow and you want to understand why a database picks one plan over another.
- Modern SQL: Window Functions: The natural "level up" after
GROUP BY. Window functions give you running totals, rankings, and moving averages without collapsing rows, which is the next tool analysts reach for.
- Kimball Group: Dimensional Modeling Techniques: The canonical reference for grain, facts, dimensions, and star schemas, from the people who named them. Skim the technique list to see how deep the rabbit hole goes.
- Star schema vs OBT (one big table): How modern columnar warehouses often flatten a star schema into a single wide table. Useful context for why Week 10 builds one big table instead of a textbook star.
Videos
- CMU Intro to Database Systems (Andy Pavlo): The full Carnegie Mellon database systems course on YouTube, free. Lecture topics on storage models (row vs columnar) and query execution go far deeper than this week needs, but a single lecture is a great deep dive if the OLAP-vs-OLTP chapter sparked your curiosity.
- Joins explained visually (Socratica): A short, beginner-friendly walk-through of INNER, LEFT, RIGHT, and FULL joins with diagrams. Good if the join Venn diagrams in Joins, CTEs, and Aggregations did not click the first time.
Community
- DataTalks.Club Slack: An active, free community of data engineers and analysts. The
#course-data-engineering channels are welcoming to beginners and a good place to ask "why is my query slow?" or "is this the right way to model this?"
- r/SQL: A large Q&A community for SQL questions across every dialect. Search before posting; most beginner questions have been answered many times.
Books
The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0
*https://hackyourfuture.net/*

Built with ❤️ by the HackYourFuture community · Thank you, contributors
Found a mistake or have a suggestion? Let us know in the feedback form.