SQL & APIs · Requested
SQL Interview Drills on Trades and Positions
Interview-ready SQL on a trades blotter: net positions with conditional aggregation, realized vs open lots, VWAP, and ranking fills with window functions.
Step 1 of 7 · Overview28 min read ·
Key idea
Prereqs: SELECT/JOIN; GROUP BY & window functions. Next: Window functions for PnL attribution. Sources: standard SQL (Postgres); interview pattern of netting buys/sells into open positions. Practice on toy data, not production books.Next: 1. The blotter shape