SQL Practice Logo

SQLPractice Online

Level 10 - MasterDebugging Questionsm1 end to end data architecture

Debug Non-Sargable Architecture Audit Query

Fix this query for index-friendly architecture audits: SELECT * FROM order_events WHERE UPPER(event_type) = 'ORDER_CREATED' AND event_ts::date = CURRENT_DATE;

Schema Context

order_events(event_id, order_id, event_type, event_ts), index(event_type, event_ts)