CodeRigor

FREE COURSE / REAL PRACTICE

SQL & relational data

Query real tables and reason about NULLs, joins, grouping, windows, transactions and indexes with runnable SQLite exercises.

Free lessons & exercises9 authored lessons4 units

What you’ll work toward

Build deterministic queries, explain relational edge cases and investigate transaction and index behavior.

Read an explanation, inspect the diagrams and work through the available checks, debugging exercises and builds. Feedback and prerequisite links guide the next step.

Before you start

The entry lesson has no earlier CodeRigor skill prerequisite. Start there and follow the sequence.

Individual lessons can add prerequisites. The course map shows your actual readiness.

A look inside the first lesson

SELECT, filtering & ordering

SQL
CREATE TABLE runs(id INTEGER PRIMARY KEY, model TEXT NOT NULL, score INTEGER NOT NULL, active INTEGER NOT NULL CHECK(active IN (0,1)));
INSERT INTO runs VALUES (9,'d',90,1),(1,'a',90,1),(2,'b',80,1),(3,'c',100,0),(4,'e',79,1);

SELECT id, model, score
FROM runs
WHERE active = 1 AND score >= 80
ORDER BY score DESC, id ASC
LIMIT 3;

Your course outline

Follow the lessons in curriculum order. Open a unit to preview the ideas you’ll work with.

UNIT 013 lessons SQL: queries, missing values & grouping
  1. LESSON 01.01

    SELECT, filtering & ordering

    Read tables, project columns, combine predicates and make top-k results deterministic.

    Open lesson
  2. LESSON 01.02

    NULL, expressions & CASE

    Use three-valued logic, distinguish missing from empty, and compute explicit result columns.

    Open lesson
  3. LESSON 01.03

    Grouping, aggregates & HAVING

    Define the row grain, distinguish COUNT forms and filter groups after aggregation.

    Open lesson
UNIT 023 lessons SQL: relationships & composed reports
  1. LESSON 02.01

    Joins, cardinality & missing matches

    Relate tables by keys, preserve unmatched rows and avoid accidental fanout.

    Open lesson
  2. LESSON 02.02

    Subqueries, EXISTS & bound parameters

    Express existence and universal conditions without NULL-sensitive NOT IN or duplicated rows.

    Open lesson
  3. LESSON 02.03

    CTEs, set operations & report grain

    Name intermediate relations, preserve event multiplicity and combine sources before reporting.

    Open lesson
UNIT 031 lesson SQL: analytical windows
  1. LESSON 03.01

    Window functions, ranks & frames

    Partition without collapsing rows, choose tie semantics and define deterministic row frames.

    Open lesson
UNIT 042 lessons SQL: integrity & access paths
  1. LESSON 04.01

    Keys, writes & transactions

    Use constraints and bound writes to preserve an invariant across success and rollback.

    Open lesson
  2. LESSON 04.02

    Indexes, plans & bounded lookups

    Design a composite B-tree access path and inspect plans without confusing indexes with correctness.

    Open lesson