SQL Practice Logo

SQLPractice Online

Level 6 - ExpertDebugging Questionsm1 data modeling

Fix Non-Deterministic Current Plan Query

Debug this query intended to fetch each customer's latest plan: SELECT customer_id, plan_code FROM customer_plan_history GROUP BY customer_id;

Schema Context

customer_plan_history(customer_id, plan_code, effective_from, changed_at)