This question evaluates data manipulation skills such as joins, date comparisons, conditional grouping, and aggregation to compute member- and country-level metrics from relational tables within the Data Manipulation (SQL/Python) domain.
You are given two tables about members and video uploads.
Table 1: video_posts
post_date
DATE — UTC calendar date of the upload
member_id
INT
video_length_seconds
INT
Table 2: members
member_id
INT
country
STRING
join_date
DATE — UTC calendar date when the member joined
Relationship:
video_posts.member_id = members.member_id
Assumptions:
video_posts
represents one uploaded video.
Write SQL (and optionally Python for part 2) for the following:
members_first_video_on_join_date
member_region = 'US'
when
country = 'usa'
, otherwise
member_region = 'Non-US'
member_region, total_video_posts
country, members_with_video_over_60s