1SELECT
2 c.name,
3 c.email,
4 COUNT(o.id) AS order_count,
5 SUM(o.total) AS revenue
6FROM customers c
7JOIN orders o ON o.customer_id = c.id
8GROUP BY c.id;
9-- Error: c.name and c.email not in GROUP BY
no lines flagged
#002PracticeEasy10 min · 50 XP
Missing GROUP BY Column
This query is supposed to count orders per customer but throws a SQL error in strict mode. Identify the faulty line.
Flagged linesNo lines flagged yet
What's wrong?
Flag a line or write a note to submit.