Your question is Average Reels Watch Time with NULLs. Start with the requirements and the one table on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
A Meta Product Growth Analyst is reviewing Instagram Reels engagement as part of the AARRR funnel. Some time_spent_seconds values are NULL because the client failed to log watch time for a subset of sessions.
Write a SQL query to calculate the average time spent on Reels by surface, while handling NULL values correctly.
surface and the average of time_spent_seconds as avg_time_spent_seconds.NULL watch-time values from the average calculation.event_date is '2024-06-01'.avg_time_spent_seconds in descending order.| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique event identifier |
| user_id | INT | Meta user identifier |
| surface | VARCHAR(50) | Instagram Reels entry surface |
| time_spent_seconds | INT | Time spent watching Reels in seconds; NULL indicates missing logging |
| event_date | DATE | Date of the watch event |