SQL practice: Errors You Will Definitely Hit
Chapter 33 · 6 questions · included in full access
Question 1 · easy
Solve it in your browserThis query fails because order_date is neither grouped nor aggregated. Fix it so order_date is aggregated with MAX() as latest_order.
Question 2 · easy
Solve it in your browserThis query fails because WHERE runs before SELECT, so the alias 'limit' doesn't exist yet. Fix the WHERE clause to use the actual column name.
Question 3 · medium
Solve it in your browserThis query fails because the subquery returns multiple customer IDs for Mumbai, but = expects exactly one value. Fix it using IN.
Question 4 · medium
Solve it in your browserThis query accidentally produces a massive Cartesian product because there is no join condition. Fix it with a proper INNER JOIN on customer_id.
Question 5 · hard
Solve it in your browserThis query fails with 'column emial does not exist'. Fix the spelling of email.
Question 6 · hard
Solve it in your browserThis query fails because customer_id exists in both tables, making the column reference ambiguous. Qualify customer_id with orders.
These questions are part of full access.
The first chapters of every track are free. Full access is a one-time payment.
See pricing