Task on PIVOT / CASE WHEN. **Condition:** Build a revenue matrix: rows — days of the week (Mon-Sun), columns — time slots (morning/day/evening/night). **Table:** ecommerce_orders (order_date, total_amount, ...) **Requirements:** 1. Divide hours into slots: 6-12 (morning), 12-18 (day), 18-24 (evening), 0-6 (night) 2. Group by day of the week and slot 3. Pivot — slots as columns **Hint:** EXTRACT + CASE for slots + conditional aggregation for pivot.
Sign in to solve
Start Solving