Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Get started
SQL: Percentage of Picked Up Calls
00:00
5 left

SQL: Percentage of Picked Up Calls

EasySQL · PostgreSQL

Problem

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.

Task

Write a SQL query that returns the picked-up call percentage for each country in the dataset, then filter to the requested country.

Requirements

  1. Join call events to country metadata.
  2. Count only calls with call_status = 'picked_up' as picked-up calls.
  3. Return the picked-up percentage as picked_up_rate_pct, rounded to 2 decimals.
  4. Filter the result to the country named India.

Output

Schema

call_events
ColumnTypeDescription
call_idPKBIGINTUnique call event identifier
user_idBIGINTMeta user who initiated or received the call
country_idINTCountry where the call was logged
call_statusVARCHAR(32)Call outcome, such as picked_up, missed, or declined
call_dateDATEDate of the call event
countries
ColumnTypeDescription
country_idPKINTCountry identifier
country_nameVARCHAR(64)Country name
regionVARCHAR(64)Geographic region
Tablescall_eventscountries
Interviewer

Whenever you're ready, walk me through your approach or go straight to the code. The requirements and the two tables are in the Question tab.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.