Between Two Prices
Return the id and price of the trades priced from 10 to 20, both ends included. Rows may come in any order.
Example 1
trades
| id | symbol | qty | price |
|---|---|---|---|
| 1 | KO | 10 | 10.0 |
| 2 | KO | 5 | 20.0 |
| 3 | XOM | 7 | 20.5 |
| 4 | XOM | 2 | 15.25 |
| 5 | KO | 1 | 9.99 |
returns
| id | price |
|---|---|
| 1 | 10.0 |
| 2 | 20.0 |
| 4 | 15.25 |
Constraints
- Up to 14 trades
Write it in your browser, against the clock. The model query, with a note on each piece of it, comes after.
More SQL problems
- Both ConditionsBeginner
- Cheapest FirstBeginner
- Each Symbol OnceBeginner
- How Many SellsBeginner
- No ManagerBeginner
- One SymbolBeginner
- One of SeveralBeginner
- Only the Big OnesBeginner