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
Start free
Find Duplicate Non-Void Claims in PostgreSQL
00:00
5 left

Find Duplicate Non-Void Claims in PostgreSQL

MediumSQL · PostgreSQL

Problem

Principal Financial Group uses claims data for operational reporting and quality checks. Write a PostgreSQL query to identify duplicate non-void claims received during 2025.

A claim is considered a duplicate when multiple records share the same member_id, claim_date, provider_code, and claim_amount. Exclude rows with a null provider_code, but retain claims whose claim_status is null. Include member details when available, without removing duplicate claims for an unmatched member.

Requirements

  1. Group claims by the four business-key columns and retain only groups containing at least two records.
  2. Return one row per duplicate business-key group, including the duplicate count.
  3. Use a LEFT JOIN to add the member name, and sort by claim date and member ID.

Schema

claims
ColumnTypeDescription
claim_idPKINTEGERUnique claim record identifier
member_idINTEGERPrincipal member identifier
claim_dateDATEDate the claim was submitted
provider_codeVARCHAR(20)Billing provider code
claim_amountNUMERIC(10,2)Submitted claim amount
claim_statusVARCHAR(20)Claim processing status
members
ColumnTypeDescription
member_idPKINTEGERUnique Principal member identifier
member_nameVARCHAR(100)Member's full name
plan_nameVARCHAR(80)Principal insurance plan name
Tablesclaimsmembers
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.

Sign up free to run or submit. Log in
CodePostgreSQL
Sign up free to run your code. Your draft is saved.Run with a free accountLog inLn 1
Run your query to see results here.