Google Analytics level task. **Condition:** Calculate monthly revenue, the percentage change compared to the previous month, and mark anomalies (growth > 50% or drop > 30%). **Table:** ecommerce_orders (order_date, total_amount, status, ...) **Requirements:** 1. Only consider paid orders (status IN ('delivered', 'shipped')) 2. Calculate MoM % = (current - previous) / previous * 100 3. Add column anomaly_flag: 'spike', 'drop', or NULL **Hint:** Use LAG() to get
Sign in to solve
Start Solving