Google Play Commerce analyzes user purchasing patterns to reward high-value players. Write a SQL query to identify users located in 'US' or 'UK' who have completed at least 3 separate in-app purchases with a combined expenditure of at least $100.00. Output the `user_id`, `username`, `country`, `total_purchases` (`COUNT`), and `total_spent` (`SUM` rounded to 2 decimal places). Order the results by `total_spent` in descending order, breaking ties by `user_id` in ascending order.
Loading…
Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.
Ask questions, share alternate queries, and explore solutions
Your recent query executions and answer checks
This will insert the verified MySQL solution into your editor so you can study how each clause transforms the table.