AnalystPath

App Time Split by Age Group

SQLMediumMid levelSnapchat~15 min

Problem

**[Asked at Snapchat]**

Snapchat tracks time users spend on two activity types: sending snaps and opening
snaps. The product team wants to know how that split varies by age group.

For each age group, calculate:
- `send_pct` — percentage of total time spent **sending**
- `open_pct` — percentage of total time spent **opening**

Round both to 2 decimal places. Order by age group.

Tables

Example rows — the live problem includes the full dataset.

snap_activity
activity_iduser_idactivity_typetime_spent
user_demographics
user_idage_group

Expected output

Your answer should return 3 rows with the columns age_group, send_pct, open_pct.

Starter code (SQL)

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