users has one row per user (user_id, signup_date) and activity_events has one row per event (user_id, event_date, event_name). A user is activated if they have at least one 'activate' event dated on or after their signup_date and no more than 7 days after it (signup_date + 7 days inclusive). Compute the percentage of all users in the users table who are activated. Output a single column: activation_rate_pct (rounded to 2 decimals).
| Column | Type |
|---|---|
| user_id | INTEGER |
| signup_date | DATE |
| user_id | signup_date |
|---|---|
| 1 | 2026-01-01 |
| 2 | 2026-01-01 |
| 3 | 2026-01-01 |
| 4 | 2026-01-01 |
| Column | Type |
|---|---|
| user_id | INTEGER |
| event_date | DATE |
| event_name | TEXT |
| user_id | event_date | event_name |
|---|---|---|
| 1 | 2026-01-03 | activate |
| 2 | 2026-01-09 | activate |
| 3 | 2026-01-05 | login |
| activation_rate_pct |
|---|
| 25 |
Solve it in the live editor on this page — run on sample data, then submit against hidden tests.
{{ totalCount }} questions in the style asked at Amazon, Microsoft, Google, Meta, Flipkart and more — {{ hardPct }}% Hard. Write SQL in a real database engine in your browser, run it on sample data, then evaluate against hidden tests.
Company tags show where this type of question is commonly reported in interviews. Questions, data and solutions are written by TechTown.
{{ cur.statement }}
No submissions yet. Press Evaluate to submit your query.
{{ solutionSql }}
{{ out.error }}
You have solved your 3 free questions — nice work! Log in (free) to unlock all 150 questions, keep your streak and appear on the leaderboard.