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
Fraud Metrics SQL Query
00:00
5 left

Fraud Metrics SQL Query

MediumSQL · PostgreSQL

Problem

Write a SQL query to analyze fraud cases by team and week, including joins across case, agent, and outcome tables, and calculate weekly resolution rates.

Use the provided tables and include cases even when an agent or outcome is missing. Treat an outcome with status Resolved as resolved.

Output

  1. One row per team and week, using the case opened date for the week.
  2. Columns: team_name, week_start, total_cases, resolved_cases, and resolution_rate_pct.
  3. Include all cases, label missing teams as Unassigned, calculate the rate as a percentage rounded to two decimal places, and order by week_start, then team_name.

Schema

fraud_cases
ColumnTypeDescription
case_idPKINTUnique fraud case identifier
agent_idINTAgent assigned to the case
opened_atTIMESTAMPTimestamp when the case was opened
priorityVARCHAR(20)Operational priority of the case
agents
ColumnTypeDescription
agent_idPKINTUnique agent identifier
agent_nameVARCHAR(100)Agent display name
team_nameVARCHAR(100)Team assigned to the agent
outcomes
ColumnTypeDescription
outcome_idPKINTUnique outcome identifier
case_idINTFraud case associated with the outcome
outcome_statusVARCHAR(30)Final or current case outcome
resolved_atTIMESTAMPTimestamp when the case was resolved
Tablesfraud_casesagentsoutcomes
Interviewer

Your question is Fraud Metrics 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.