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
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
Get started
SQL Joins and Aggregations
00:00
5 left

SQL Joins and Aggregations

MediumSQL · PostgreSQL

Problem

How would you write a SQL query using joins and aggregations to identify the top-performing tickers at Balyasny Asset Management?

Use the supplied ticker, desk, and PnL records. Consider finalized records from 2025 and retain tickers with at least two records.

Output

  1. Return the five highest-performing tickers.
  2. Include ticker_symbol, asset_class, total_net_pnl, pnl_records, trading_days, and performance_rank.
  3. Order by total net PnL descending, then ticker symbol ascending for ties.

Schema

tickers
ColumnTypeDescription
ticker_idPKINTUnique ticker identifier
ticker_symbolVARCHAR(20)Ticker symbol
asset_classVARCHAR(30)Asset classification
is_activeBOOLEANWhether the ticker is currently active
desks
ColumnTypeDescription
desk_idPKINTUnique desk identifier
desk_nameVARCHAR(50)Investment desk name
strategyVARCHAR(40)Desk investment strategy
pnl_records
ColumnTypeDescription
pnl_idPKINTUnique PnL record identifier
ticker_idINTReferenced ticker
desk_idINTReferenced investment desk
pnl_dateDATEDate of the PnL record
net_pnlNUMERIC(14,2)Net profit or loss
statusVARCHAR(15)Record finalization status
Tablestickersdeskspnl_records
Interviewer

Your question is SQL Joins and Aggregations. 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.