Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

SQL Aggregation Query

EasySQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is SQL Aggregation Query. Start with the requirements and the one table on the right.

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.

Problem

Cotiviti's claims analytics team needs a summary of approved claims processed during 2025. Write a PostgreSQL query using the claims table to report claim volume and total allowed amount by provider specialty.

Requirements

  1. Include only claims with claim_status = 'Approved' and a service_date on or after January 1, 2025.
  2. Return one row per provider specialty with the approved claim count and total allowed amount, ordered from highest to lowest total.

Schema

claims
ColumnTypeDescription
claim_idPKINTUnique claim identifier
provider_specialtyVARCHAR(80)Specialty associated with the servicing provider
claim_statusVARCHAR(20)Claim processing status
service_dateDATEDate of service
allowed_amountNUMERIC(12,2)Amount allowed for the claim
Tablesclaims
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results