Interview Query

Payments Received

2
Have you seen this question before?

You’re given two tables, payments and users. The payments table holds all payments between users with the payment_state column consisting of either "success" or "failed"

How many customers that signed up in January 2020 had a combined (successful) sending and receiving volume greater than $100 in their first 30 days?

Note: The sender_id and recipient_id both represent the user_id.

payments table

Column Type
payment_id INTEGER
sender_id INTEGER
recipient_id INTEGER
created_at DATETIME
payment_state VARCHAR
amount_cents INTEGER

users table

Column Type
id INTEGER
created_at DATETIME

Output:

Column Type
num_customers INTEGER
Next question: Newsfeed Model
.....
MySQL 8.0.17
Loading editor
Use Shift + Enter to run query