Instagram College Students Visiting Search on the Day of Registration, by Country
Table: ig_users
This table has one row for every Instagram user.
Columns:
user_idINT— The unique identifier of the Instagram usercountrySTRING— Country of the useris_collegeBOOLEAN— Indicates whether a user is a college studentreg_dateDATE— Date that the user joined Instagram
Sample Rows:
user_id | country | is_college | reg_date
1012 | US | TRUE | 2019-02-02
7506 | JP | FALSE | 2015-04-07
3098 | IN | TRUE | 2017-12-05
8904 | US | TRUE | 2020-06-19
Table: ig_time_spent
This table has data on how users spend time on Instagram, aggregated per surface.
Columns:
dateDATE— The date that the user visited Instagramuser_idINT— The unique identifier of the Instagram usersurfaceSTRING— Which surface the user visitedtime_spentDOUBLE— The amount of time (in seconds) spent on that surface
Sample Rows:
date | user_id | surface | time_spent
2020-12-02 | 1012 | profile | 279.856
2020-12-02 | 1012 | stories | 433.775
2020-12-02 | 3652 | search | 68.233
2020-12-01 | 7506 | stories | 342.190
By country, what percentage of all college students that joined Instagram on 2023-12-01 went to Search on the same day of registration?
这道题考察的是按国家分组统计转化比例:先从 <code>ig_users</code> 中筛选出在 <code>2023-12-01</code> 注册且是大学生的用户,再与 <code>ig_time_spent</code> 按 <code>user_id</code> 和当天日期关联,找出注册当天是否访问了 <code>search</code> 页面。最后按 <code>country</code> 计算“访问过 Search 的大学生人数 / 当天注册的大学生总人数”并转成百分比即可。关键点在于先限定注册日期,再判断同一天的行为记录,通常会用条件聚合或分组统计来完成。