Calculate the percentage of picked up calls for a certain country.
Asked in the Onsite stage. SQL task in PGA interview regarding call metrics by country.
Write a SQL query that returns the picked-up call percentage for each country in the dataset, then filter to the requested country.
call_status = 'picked_up' as picked-up calls.picked_up_rate_pct, rounded to 2 decimals.India.| Column | Type | Description |
|---|---|---|
| call_idPK | BIGINT | Unique call event identifier |
| user_id | BIGINT | Meta user who initiated or received the call |
| country_id | INT | Country where the call was logged |
| call_status | VARCHAR(32) | Call outcome, such as picked_up, missed, or declined |
| call_date | DATE | Date of the call event |
| Column | Type | Description |
|---|---|---|
| country_idPK | INT | Country identifier |
| country_name | VARCHAR(64) | Country name |
| region | VARCHAR(64) | Geographic region |