AnalystPath

L7 Power-User Curve

SQLHardSenior level~15 min

Problem

**[Classic — product analytics]**

The L7 power-user curve shows how many users were active for exactly N days
in a 7-day window.

For the window **2023-01-01 to 2023-01-07**, return a histogram of users
by number of distinct active days.

Return `days_active` and `user_count`, ordered by days_active.

Tables

Example rows — the live problem includes the full dataset.

activity
activity_iduser_idactivity_date

Expected output

Your answer should return 3 rows with the columns days_active, user_count.

Starter code (SQL)

SELECT *
FROM 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

Related SQL questions