LevichAcademy
0%

Levich Academy · Course 01

Get genuinely good at SQL.
48 days, one at a time.

A real Postgres runs right here in your browser. You write the queries, we check them, and you always know exactly where you stand. Free, no card, and you can start in about a minute.

Start Day 1, free

48 days · 241 problems · free, forever

Day 22 · Window functionsProblem 03 of 05

For every customer, show their most recent order and how many days passed since the one before it.

SELECT customer_id, placed_at,
       placed_at - lag(placed_at) OVER (
         PARTITION BY customer_id ORDER BY placed_at
       ) AS since_previous
FROM orders;
Correct. 8,412 rows, every column matched

You cannot fool this one.

Most courses let you nod along and move on. Here the query actually runs. Write it your way, name the columns what you like, and it still passes.Get it wrong and you will know.

Who this is for

Still studying

You have written SELECT in a lab and it felt easy. Then an interview asked for a window function and it really was not. 48 days closes that gap, with nothing to install and nothing to pay.

Already working

Your SQL works and you quietly hope nobody asks why. You have meant to fix that for ages. Two hours a day, in order, and you stop guessing, including the bits interviews love.

What you will be able to do

How it works

  1. 01

    Open today. You never have to plan anything. 48 days in order, each one building on the last.

  2. 02

    Read it, then try it. Every lesson explains why it works, not just what to type. Then you write real queries against real data.

  3. 03

    Find out straight away. Your query runs and we compare the result. If it is off, we tell you how it differs and let you fix it yourself.

What this is, and what it is not

The whole curriculum

  1. 01

    Databases and SQL

    What a database actually is · Data types and creating tables · Changing data: INSERT, UPDATE, DELETE · …

    6 days · 28 problems
  2. 02

    Querying data

    Getting rows out: SELECT, WHERE, ORDER BY · NULL: the thing that silently breaks queries · Aggregation: GROUP BY and HAVING · …

    12 days · 64 problems
  3. 03

    Advanced SQL

    ANY, ALL, EXISTS and NOT EXISTS · Window functions: the idea · Ranking: ROW_NUMBER, RANK, DENSE_RANK · …

    12 days · 52 problems
  4. 04

    Performance and modelling

    How a query actually runs, and reading EXPLAIN · Indexes: what they are and when they are ignored · Sargability, why your index is being ignored · …

    12 days · 56 problems
  5. 05

    Interview problems

    The project: a parcel logistics report · Interview problems: warm-up · Interview problems: medium, part one · …

    6 days · 41 problems
Start Day 1, free

About a minute to start. Nothing to install.