Module · Data Engineer
SQL & Query Craft
The language every data platform speaks - and the only way to get an answer twice as fast.
TOPIC 01
Query Foundations
Read a question, model it as a join, and get the rows back in the order you meant.
What you'll practice
- Join and Filter Like a Pro — guided · beginner
- Aggregate With Window Functions — practice · intermediate
A command you'll meet
cat ~/warehouse/queries/active_users.sqlEvery analytics problem is a join plus an aggregate. Open the task below for the full walkthrough.
Hands-On Tasks in This Topic (2)
Join and Filter Like a Pro
The first query you ever write is a join. Build one that lists the active users and the number of orders each of them placed.
Aggregate With Window Functions
Totals tell you where you are, comparisons tell you where you are going. Write the daily revenue query with a running total and a day-over-day comparison.
TOPIC 02
Indexes & Query Plans
Why the same query is fast on Monday and slow on Friday - and what the plan tells you.
What you'll practice
- Index the Warehouse — practice · intermediate
- Read a Query Plan — challenge · advanced
A command you'll meet
cat ~/warehouse/indexes.sqlThe plan tells you what the database actually did, not what you asked it to do. Open the task below for the full walkthrough.
Hands-On Tasks in This Topic (2)
Index the Warehouse
An index is a bet on the queries you actually run. Write the indexes for the two hot paths of the orders table.
Read a Query Plan
The plan tells you what the database did. Read one, find the expensive step and write down what you will change.