Question DB-SQL-0046
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 id FROM orders WHERE amount > (SELECT AVG(amount) FROM orders) ORDER BY id;
- A.
4, 5
- B.
1, 4, 5
- C.
Sign up free to see the answer and a step-by-step explanation.