CoreTrail

SQL, one concept at a time.

Understand the query. Read the result. Know why it works.

All CoreTrail subjects

A practical path from your first SELECT to window frames, query plans, and database design. Short lessons, worked examples, and the edge cases that make interview answers reliable.

Choose a learning path

Build query fluency
Prepare for interviews
  1. Revision maps
  2. Worked patterns
  3. Mixed drills
  4. Explain edge cases aloud
Investigate performance

Explore the chapters

Make the examples work for you

PostgreSQL is the main dialect. Each lesson states its assumptions; dialect-specific syntax is labelled. Follow the reading order or search directly for a function or problem.

  1. State the output grain
  2. Run the query
  3. Add a duplicate, null, or tie
  4. Compare and explain the result

Before running a query, state the output grain. After running it, add a duplicate, a null, or a tie. Explaining that second result is often where the learning happens.

Get the practice dataset   Sources & coverage

Type a concept, keyword, or function.