Problem Description

For each customer, show total paid amount in the last 30 days. Join Orders with Payments and group by customer.

Input Format

SQL query

Output Format

Result set

Sample Test Case

Input:
Payments(order_id, amount, paid_at), Orders(order_id, customer_id)
Output:
Customer totals

Constraints

Assume PostgreSQL-style interval

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next