Dataslope logoDataslope

Next Steps

A recap of the analytical mindset and toolkit you built, one last query that ties it together, and where to go next on your data analysis journey.

You began this course knowing basic SQL but unsure how analysts actually use it. Now you can profile an unfamiliar dataset, summarize millions of rows, rank and accumulate with window functions, reshape data, compose readable pipelines, and turn raw rows into trustworthy business metrics. More importantly, you understand why each technique exists — which is the part that outlasts any one tool.

What you built up

The course moved deliberately from mindset to technique to insight:

Each layer rested on the one before it. Window functions only made sense once aggregation did; metrics only made sense once you could compose queries; reproducibility tied the whole craft together.

The big ideas worth keeping

If you remember only a handful of things, make it these:

  • Analytics is "many rows in, few numbers out." The whole discipline is condensing data you cannot read into knowledge you can act on.
  • Aggregation summarizes instead of rows; window functions summarize alongside them. Knowing which you need is half of analytical SQL.
  • Explore in a loop. Ask, query, look, and let each result sharpen the next question.
  • A metric is a definition first, SQL second. State it in a sentence, then translate it literally — and say which denominator you used.
  • Compose for humans. CTEs, honest names, and stable ordering make analysis readable, reproducible, and trustworthy.

You can now read real analytical queries

Pick almost any analytical query in the wild and you can decode it: spot the slice in WHERE, the summary in GROUP BY, the per-row context in OVER, and the pipeline in the WITH steps. That literacy is exactly what this course set out to give you.

One last query — the whole course in one screen

This query uses a CTE pipeline, conditional aggregation, a window function, safe division, and a stable ordering — nearly every idea from the course, working together. Read it top to bottom and predict the result before running it.

SQL
DuckDB 1.32.0

If you can read that and explain each column — the filtered sum, the share-of-total window, the month-over-month LAG, the divide-by-zero guard — you have genuinely learned to think analytically in SQL.

Try it yourself

A final challenge that exercises the core loop: aggregate, rank within groups, and keep the top of each.

SQL Challenge
DuckDB 1.32.0
Top product per category by revenue

A table sales is pre-loaded with columns category, product, and amount. Return one row per category containing the category, the product with the highest total revenue in that category, and that revenue. Columns: category, product, revenue. Sort by revenue descending.

Where to go from here

This was an analytical SQL course. Natural next steps include:

  • Joins for analysis in depth — combining fact and dimension tables, semi/anti joins, and ASOF joins for time-aligned data.
  • Statistical functions — percentiles, MEDIAN, correlation, and approximate aggregates for very large data.
  • Reading real files — pointing DuckDB at CSV and Parquet, and querying data straight from cloud storage.
  • From query to chart — feeding your summaries into a visualization or notebook to communicate the story.
  • dbt and analytics engineering — turning ad-hoc queries into tested, documented, reproducible data models.

But there is no rush. The analytical way of thinking you built here — many rows in, few numbers out; explore in a loop; define before you compute — is the foundation everything else stands on. Keep asking questions of data, keep writing queries, and the rest will follow.

Welcome to data analysis with SQL.

On this page