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
Top Commercial Clients by Loan Volume
00:00
5 left

Top Commercial Clients by Loan Volume

EasySQL · PostgreSQL

Problem

You are given commercial lending data and asked to write a SQL query that returns the top 5 commercial clients by total loan volume, excluding any client marked with a high-risk flag. Use the client-level risk status to filter out ineligible clients, then aggregate funded loan amounts across each remaining client.

Schema

clients
ColumnTypeDescription
client_idPKINTUnique identifier for each client
client_nameVARCHAR(100)Commercial or retail client name
client_typeVARCHAR(30)Client segment such as Commercial or Retail
client_risk_flags
ColumnTypeDescription
client_idINTReferences the client
high_risk_flagBOOLEANWhether the client is currently marked high risk
review_dateDATEDate of the risk review
loans
ColumnTypeDescription
loan_idPKINTUnique identifier for each loan
client_idINTReferences the borrowing client
loan_amountDECIMAL(14,2)Funded or requested loan amount
loan_statusVARCHAR(30)Loan status such as Funded, Pending, or Cancelled
Tablesclientsclient_risk_flagsloans
Interviewer

Your question is Top Commercial Clients by Loan Volume. 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.