Where a Digital Media Store Makes Its Money
Three production-style SQL analyses on the Chinook schema — window functions, CTE pipelines, conditional pivoting, and recursive string normalization — all runnable live in the browser.
Dataset: Chinook (digital music store). Analysis and queries are my own.
Advanced SQL showcases
Each card loads a full analytical query. Run it as-is, read the design notes below the results, or edit the SQL.
Query output
Results appear here after you run a query.
Database reference 11 tables · click to preview
Loading schema…
What this demonstrates
- Modular CTE pipelines + windows — customer spend quartiles, inter-purchase gaps, and running lifetime value without nested subqueries.
- Pivot-style reporting in SQL — country × year and Rock vs non-Rock revenue with share-of-global metrics in one pass.
-
1NF correction in-query — recursive delimiter splitting on
Track.Composerso composer rankings are not inflated by multi-value cells.