Something went wrong!
Hang in there while we get back on track
Examples for Business Question to SQL Translator
Explore real-world examples showing how this skill works with different inputs and outputs.
Monthly Churn Rate by Subscription Tier
Calculates monthly churn rate segmented by subscription tier while excluding trial users who never activated. Demonstrates complex filtering logic, time series generation with generate_series, and proper churn rate formula (churned/active at month start).
Running Revenue Totals with Year-over-Year Comparison
Calculates cumulative revenue and customer count by week with same-week-last-year comparison. Demonstrates window functions for running totals (SUM OVER with PARTITION BY year), week number alignment for YoY comparison, and percentage change calculations with division-by-zero handling.
Signup to Purchase Conversion by Traffic Source
Calculates conversion rate from signup to first purchase, segmented by traffic source for last month. Demonstrates LEFT JOIN strategy to preserve non-converters in denominator, ROW_NUMBER for first purchase identification, and edge case handling for cancelled/refunded orders.