Loading exercise…
Loading exercise…
Exercises are built for a keyboard. Read the task here, then open this page on a laptop to solve it.
Actual vs target vs last year. Actuals, targets and prior-year numbers usually live in different tables at different grains. Bring each to the same grain (one row per region) in its own WITH step, then join the steps. Attainment is actual ÷ target; year-over-year change is (this year − last year) ÷ last year.
with prior as ( select region_id, sum(revenue) as revenue_2024 from revenue_2024 group by region_id ) select r.region, round(p.revenue_2024, 2) as revenue_2024 from prior p join regions r on r.region_id = p.region_id
For the year-end review, the CFO wants one scorecard per region: 2025 revenue against target and against 2024.
Return region, revenue_2025 (completed, 2 decimals), target (full-year sum of revenue_target), pct_of_target (2 decimals), revenue_2024 (full-year sum from revenue_2024, 2 decimals) and yoy_pct (the change from 2024 to 2025 as a percent of 2024, 2 decimals).
Loading the Brightline dataset…
Language
Full plan
SQL ✓ · Excel and Power BI also included
Cancel anytime · 14-day full refund · Secure payment by Stripe