SQL Practice Logo

SQLPractice Online

Level 5 - SeniorOptimization Questions

Optimization: OR Predicate Rewrite

Interviewer prompt: Choose more index-friendly form for two selective statuses. Query A: SELECT order_id FROM orders WHERE status = 'PAID' OR status = 'REFUNDED'; Query B: SELECT order_id FROM orders WHERE status IN ('PAID','REFUNDED');