Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Analyze Decision Impact by Region

MediumSQL · PostgreSQL00:00
I
Practice interviewer
Your interviewer
In session
I
Interviewer

Welcome to the SQL screen.

The question is on your right: Analyze Decision Impact by Region. Read through the requirements and the three tables first.

Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?

You need to log in / sign up to run or submit.

Problem

You are given transaction, decision, and client data from an investment operations workflow. Write a PostgreSQL query that helps you decide whether a process change improved outcomes: for each region, return the number of decisions made, the number of successful outcomes, and the success rate for decisions made in Q2 2024. Only include regions with at least 2 decisions, and sort by success rate descending, then region ascending.

Schema

decisions
ColumnTypeDescription
decision_idPKINTPrimary key for each decision record
client_idINTClient associated with the decision
decision_dateDATEDate the decision was made
decision_typeVARCHAR(50)Type of decision
decision_outcomes
ColumnTypeDescription
decision_idINTForeign key to decisions.decision_id
outcome_statusVARCHAR(20)Outcome status such as success or failure
resolved_atTIMESTAMPWhen the outcome was recorded
clients
ColumnTypeDescription
client_idPKINTPrimary key for each client
regionVARCHAR(50)Client region
account_nameVARCHAR(100)Client account name
Tablesdecisionsdecision_outcomesclients
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results