Reactivated Users After Churn
Problem
**[Asked at Meta]**
A user "reactivates" when they log in after a gap of **more than 30 days**.
Find all users who have reactivated at least once. Return `user_id`, ordered ascending.
Tables
Example rows — the live problem includes the full dataset.
logins
| login_id | user_id | login_date |
|---|
Expected output
Your answer should return 2 rows with the columns user_id.
Starter code (SQL)
SELECT *
FROM logins;Solve this SQL question free
Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock