Tell me about how you would design a schema for a new user-activity tracking feature to ensure low-latency querying at AWS.
For this hands-on exercise, use the provided tables to represent the schema and write the query needed to retrieve a recent activity summary. Restrict activity to the inclusive start and exclusive end timestamps specified in the query.
Output
- One row per user, including users with no activity in the time range.
- Columns:
user_id, email, activity_count, categories_seen, latest_activity_at, and latest_activity_name.
- Order by activity count descending, latest activity descending with nulls last, then user ID ascending.