SolveWithSQL

Intermediate SQL Challenges

Welcome to the Intermediate SQL Challenges track on SolveWithSQL.

If you’ve completed the beginner series, you already know how to filter, join, aggregate, and produce reliable Top-N results. In intermediate, we shift from “writing correct queries” to thinking like a data analyst: answering multi-step business questions, handling edge cases, and using SQL patterns that show up in real products, dashboards, and analytics workflows.

Who this track is for

This track is ideal if you can comfortably use:

  • SELECT, WHERE, ORDER BY, LIMIT
  • GROUP BY and aggregates like COUNT, SUM, AVG
  • JOINs (INNER / LEFT)
  • HAVING and tie-break sorting

If any of those still feel shaky, start (or revisit) the Beginner SQL Challenges first.

What you’ll learn in Intermediate

Intermediate challenges focus on practical patterns like:

  • Subqueries and query composition
  • Derived tables / CTEs (clean, readable SQL)
  • Window functions (ranking, running totals, moving averages)
  • “Top per group” problems (top product per category)
  • Cohorts and retention-style analysis (in a simplified form)
  • Data quality checks (duplicates, gaps, mismatches)
  • Pagination and performance-minded query design

How to use this track

For each challenge:

  1. Read the product manager request (that’s the “real” problem).
  2. Write your SQL solution first.
  3. Compare with the provided solution and explanation.
  4. Try the bonus variants to build flexibility.

If you want the fastest growth: do one challenge per day and post your result (or approach) on social.

Intermediate Challenge Index

The intermediate list is being published in waves. Each challenge includes:

  • A business-style prompt (“The product manager asks…”)
  • A sample dataset schema
  • Expected output
  • A solution + explanation
  • A GitHub README for practice and sharing

Start here

  • Intermediate Challenge #1: Coming next
  • Intermediate Challenge #2: Coming next
  • Intermediate Challenge #3: Coming next

(As you publish, add the links below and keep this page as the single canonical index.)

Recommended workflow

  • Use any SQL engine (PostgreSQL, MySQL, SQLite, BigQuery, etc.)
  • Focus on clarity first, then optimize
  • Save each solution in your GitHub challenge repo
  • Keep results reproducible (consistent ordering, explicit tie-breakers)

Completion milestone

When you finish the intermediate track, you should be able to:

  • Combine multiple SQL concepts into one clean query
  • Debug unexpected results logically
  • Write analysis-ready queries for dashboards and reporting
  • Handle edge cases (ties, missing data, duplicates) confidently

Call to action

Ready to level up?

Start the Intermediate SQL Challenges and build SQL skills that translate directly to analytics work, product insights, and reporting.