DAU/MAU Stickiness per Day
Problem
**[Asked at Snapchat]**
Stickiness = DAU / MAU. DAU = distinct users active that day. MAU = distinct users active in the preceding 28 days.
Return `activity_date`, `dau`, `mau`, and `stickiness` (rounded to 2 dp), ordered by date.
Tables
Example rows — the live problem includes the full dataset.
user_activity
| activity_id | user_id | activity_date |
|---|
Expected output
Your answer should return 3 rows with the columns activity_date, dau, mau, stickiness.
Starter code (SQL)
SELECT *
FROM user_activity;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