SQLQuokka
Start practicing
QuestionsLearnSandboxFeaturesRoadmapFAQ

Weekly GMV and Repeat Buyers

Unsolved

Amazon's retail analytics team reports on fiscal weeks defined in calendar_weeks (week_start to week_end, both inclusive). An order belongs to the week that contains its order date; the time of day does not matter, so an order at 23:30 on week_end still belongs to that week. Only orders with status = 'completed' count. Every week in calendar_weeks must appear, with 0 for weeks that have no completed orders. Write an SQL query that returns week_start, weekly_gmv (the sum of gmv of completed orders) and repeat_buyers (the number of users with at least 2 completed orders in that week). Order the results by week_start ascending.

SQL Query Editor (Ctrl+Enter to run)
0 characters · Valid
Canonical Solution Official

Official Solution is Hidden

Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.

Community Q&A & Discussion

Ask questions, share alternate queries, and explore solutions

0 comments
Asked By:
🏢 Amazon

Submission History

Your recent query executions and answer checks

Execution Pipeline:
FROM calendar_weeks
Full source dataset
4 rows total
Ready. Type a query to see live execution.
Clause: Auto-Sync · AlaSQL Engine