Courses / Course 01
SQL Foundations
Start from zero and finish writing the queries analysts and data engineers write every day, in a SQL sandbox right in your browser.
- BeginnerLevel
- about 1.5 hoursTo complete
- 8 lessonsWith checked exercises
- FreeNo account needed
What you will learn
- Select, filter, sort and calculate with SQL
- Summarise data with GROUP BY and HAVING
- Join tables and find missing records
- Write readable multi-step queries with CTEs
- Use window functions for rankings and running totals
Syllabus
- 1Meet the data8 min
Before writing any SQL, get to know the shop you will be working with: its four tables, what one row means, and how they connect.
- 2Your first query10 min
Tables, rows and columns, and how to ask a database for exactly the columns you need.
- 3Filtering and sorting12 min
Keep only the rows you need with WHERE, and put them in order with ORDER BY.
- 4Counting and summarising12 min
Turn thousands of rows into a few useful numbers with COUNT, SUM, AVG and GROUP BY.
- 5Joining tables15 min
Combine customers, orders and products with INNER and LEFT joins.
- 6Subqueries and CTEs12 min
Break hard questions into steps you can read, test and reuse.
- 7Window functions15 min
Rankings, running totals and comparisons with the previous row, without losing any rows.
- 8Mini project: the monthly report20 min
Put it all together and build the three numbers the shop's owner asks for every month.
The data you will use
Nordic Shop
A small online shop based in Finland that sells electronics, home goods, sports gear, books and outdoor clothing. Customers sign up, place orders on the website or in the app, and each order contains one or more products.
Tables: customers, products, orders, order_items
Helsinki City Bikes
Real open data from the city bike system in Helsinki and Espoo. Bikes are available from April to October each year, so there is no data for the winter months.
Tables: stations, daily_trips
The lesson Meet the data walks you through every table and column. Under every code box you can also open a list of the tables and what each column means.
Learn in public on GitHub
Do the exercises in the browser, or in the public course repo so your work shows on your GitHub profile.
Fork the course repo
One click on GitHub gives you your own copy with every exercise and dataset.
Solve and open a pull request
Put your answers in your own folder and open a pull request. A bot checks them and comments with ✅ or ❌.
Join the graduates
Finished a course? Add your name to GRADUATES.md. Your work stays on your GitHub profile for recruiters to see.
What you will build
A monthly report for an online shop: revenue by month, best sellers and repeat customers.