You're a data analyst at YouTube, tasked with understanding user engagement in terms of sessions and rewards given to content creators. On YouTube, viewers can send "stars" as a form of appreciation and reward to content creators during live sessions.
You need to understand the current state of this feature. For that, your request is to calculate the number of sessions per user and the total number of stars sent per user, by region and country.
To answer this request, you will be using the user_session table. The table includes the following columns:
| Column Name | Description |
|---|---|
| session_id | Unique identifier for each user session |
| user_id | Identifier for the user |
| country | Country of the user |
| region | Region within the country |
| stars_sent | Number of stars sent by the user in a session |
Hint: You're dealing with ratios - make sure to multiply 1.00 to avoid your results being rounded
| region | country | nb_users_per_session | nb_stars_per_user |
|---|---|---|---|
| Africa | Egypt | 1 | 4 |
| Africa | Nigeria | 1 | 72.333... |
| Africa | South Africa | 1.3333.. | 78.666... |
You're a data analyst at YouTube, tasked with understanding user engagement in terms of sessions and rewards given to content creators. On YouTube, viewers can send "stars" as a form of appreciation and reward to content creators during live sessions.
You need to understand the current state of this feature. For that, your request is to calculate the number of sessions per user and the total number of stars sent per user, by region and country.
To answer this request, you will be using the user_session table. The table includes the following columns:
| Column Name | Description |
|---|---|
| session_id | Unique identifier for each user session |
| user_id | Identifier for the user |
| country | Country of the user |
| region | Region within the country |
| stars_sent | Number of stars sent by the user in a session |
Hint: You're dealing with ratios - make sure to multiply 1.00 to avoid your results being rounded
| region | country | nb_users_per_session | nb_stars_per_user |
|---|---|---|---|
| Africa | Egypt | 1 | 4 |
| Africa | Nigeria | 1 | 72.333... |
| Africa | South Africa | 1.3333.. | 78.666... |