Question DB-SQL-0044
MediumWhat does this query return for the table below?
Table orders:
| id | customer | city | amount | status |
|---|---|---|---|---|
| 1 | Ravi | Pune | 1200 | shipped |
| 2 | Meena | Delhi | 800 | pending |
| 3 | Ravi | Pune | 450 | shipped |
| 4 | Kiran | Mumbai | 2000 | cancelled |
| 5 | Meena | Delhi | 1500 | shipped |
| 6 | Arjun | Pune | NULL | pending |
| 7 | Kiran | Mumbai | 700 | shipped |
SELECT city, COUNT(*) FROM orders WHERE status <> 'cancelled' GROUP BY city ORDER BY city;
- A.
Delhi | 2, Mumbai | 2, Pune | 3
- B.
Delhi | 2, Mumbai | 1, Pune | 3
- C.
Sign up free to see the answer and a step-by-step explanation.