Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
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
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess 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
Build my plan
Claims Frequency SQL Query
00:00
5 left

Claims Frequency SQL Query

MediumSQL · PostgreSQL

Problem

Write a SQL query to identify policyholders who have filed more than two claims within a six-month period at Travelers. Treat each claim filing date as the end of an inclusive six-month period, and evaluate claims across all policies owned by the same policyholder.

Output

  1. One row per qualifying policyholder, including policyholder_id, policyholder_name, claims_in_six_month_period, period_start, and period_end.
  2. Include only periods containing more than two claims.
  3. Order by claims_in_six_month_period descending, then policyholder_id ascending.

Schema

policyholders
ColumnTypeDescription
policyholder_idPKINTUnique policyholder identifier
policyholder_nameVARCHAR(100)Policyholder's full name
policies
ColumnTypeDescription
policy_idPKINTUnique policy identifier
policy_numberVARCHAR(30)Business-facing policy number
policyholder_idINTPolicy owner, referencing policyholders
claims
ColumnTypeDescription
claim_idPKINTUnique claim identifier
policy_idINTPolicy associated with the claim
filed_dateDATEDate the claim was filed
Tablespolicyholderspoliciesclaims
Interviewer

Your question is Claims Frequency SQL Query. Start with the requirements and the three tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

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.