SQL Practice Logo

SQLPractice Online

Level 5 - SeniorDebugging Questions

Debug: Slow Top-N Query

Interviewer prompt: Query is slow: SELECT * FROM trades WHERE symbol = 'AAPL' ORDER BY trade_ts DESC LIMIT 100; Table has index only on trade_ts. Provide better index DDL.