One Symbol
Return the id and qty of the trades in the symbol AAPL. Rows may come in any order.
Example 1
trades
| id | symbol | qty | price |
|---|---|---|---|
| 1 | AAPL | 10 | 190.5 |
| 2 | MSFT | 5 | 410.0 |
| 3 | AAPL | 7 | 191.0 |
returns
| id | qty |
|---|---|
| 1 | 10 |
| 3 | 7 |
Constraints
- Up to 12 trades
- Symbols are written in capitals
Write it in your browser, against the clock. The model query, with a note on each piece of it, comes after.
More SQL problems
- One of SeveralBeginner
- Only the Big OnesBeginner
- Starts With ABeginner
- Three LargestBeginner
- Trade ValueBeginner
- Two ColumnsBeginner
- Average per SymbolEasy
- Biggest SpenderEasy