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

  1. 1
    Meet the data

    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.

    8 min
  2. 2
    Your first query

    Tables, rows and columns, and how to ask a database for exactly the columns you need.

    10 min
  3. 3
    Filtering and sorting

    Keep only the rows you need with WHERE, and put them in order with ORDER BY.

    12 min
  4. 4
    Counting and summarising

    Turn thousands of rows into a few useful numbers with COUNT, SUM, AVG and GROUP BY.

    12 min
  5. 5
    Joining tables

    Combine customers, orders and products with INNER and LEFT joins.

    15 min
  6. 6
    Subqueries and CTEs

    Break hard questions into steps you can read, test and reuse.

    12 min
  7. 7
    Window functions

    Rankings, running totals and comparisons with the previous row, without losing any rows.

    15 min
  8. 8
    Mini project: the monthly report

    Put it all together and build the three numbers the shop's owner asks for every month.

    20 min

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.

  1. Fork the course repo

    One click on GitHub gives you your own copy with every exercise and dataset.

  2. 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 ❌.

  3. Join the graduates

    Finished a course? Add your name to GRADUATES.md. Your work stays on your GitHub profile for recruiters to see.

Open this course on GitHub →

What you will build

A monthly report for an online shop: revenue by month, best sellers and repeat customers.