
25 Problems
SQL Sheet
Learn SQL through practical data science queries. From SELECT basics to window functions and CTEs used in real ML data pipelines.
10 Easy13 Medium2 Hard
Unlock the full study plan
Upgrade to Pro to access the full curriculum.
5 sections
What you will learn
SQL is how most data is pulled out of databases before it reaches a model. This plan has 25 problems in five sections, from basic queries to joins, aggregation, window functions and common table expressions, using the kinds of queries found in ML data pipelines.
Prerequisites
None. The first section starts with SELECT and builds up from there.
The sections, in order
- SELECT fundamentals: SELECT, WHERE, ORDER BY, LIMIT and OFFSET, and DISTINCT.
- Joins and relationships: inner, left, self, multiple and cross joins.
- Aggregation: GROUP BY, HAVING, COUNT, SUM and AVG, conditional and nested aggregation.
- Window functions: ROW_NUMBER, RANK and DENSE_RANK, running totals, NULL handling, LAG and LEAD.
- Advanced queries: subqueries, common table expressions, CASE, and date and string functions.
Where to go next
Work with the same data in Python using the Pandas study plan, which covers grouping, pivoting and merging with DataFrames.