You have a table orders(order_id, user_id, order_date, revenue). Write a single SQL query that returns: user_id, order_date, revenue, a 7-day rolling sum of revenue per user, and their revenue rank on each day across all users.
Sign in to see what a strong answer covers and to get AI feedback on your own.