Practice Interview Questions
| Question | Status |
|---|---|
Write a query to calculate the click-through rate (CTR %) of an app in 2022. The CTR is defined as the percentage of clicks out of all impressions made in the year 2022.
Output the results in percentages rounded to 2 decimal places.
Notes:
events table:
| Column Name | Description |
|---|---|
| app_id | Identifier for the app |
| event_type | Type of event (e.g., 'click', 'impression') |
| timestamp | Time when the event occurred |
| ctr |
|---|
| 123 | 50.00 |
| 234 | 100.00 |
Write a query to calculate the click-through rate (CTR %) of an app in 2022. The CTR is defined as the percentage of clicks out of all impressions made in the year 2022.
Output the results in percentages rounded to 2 decimal places.
Notes:
events table:
| Column Name | Description |
|---|---|
| app_id | Identifier for the app |
| event_type | Type of event (e.g., 'click', 'impression') |
| timestamp | Time when the event occurred |
| app_id | ctr |
|---|---|
| 123 | 50.00 |
| 234 | 100.00 |