Analytics Patterns
Learn SQL analytics patterns with practical examples and guided drills on dbSyntax.
Start with Top-N Per GroupTop-N Per Group
Intermediate"Top 3 products per category." "Highest-spending customer per region." "Latest order per user." These all fit the same shape: rank within a ...
Cohorts & Retention
IntermediateA cohort is a group of users who share a starting event, such as "everyone who signed up in March 2024". Retention asks: of that group, how ...
Funnels
IntermediateA funnel measures how many users complete each step of an ordered sequence: view → add_to_cart → checkout → purchase. The drop-off between s...
Rolling Metrics & Period-over-Period
IntermediateExecutives don't ask "what was revenue on Tuesday?" They ask "how's revenue trending, and is it up or down vs last week?" The answer needs t...