Two Columns
Return the symbol and qty of every row in trades, one result row per trade. 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 | 10 | 191.0 |
returns
| symbol | qty |
|---|---|
| AAPL | 10 |
| MSFT | 5 |
| AAPL | 10 |
Constraints
- Up to 12 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
- Average per SymbolEasy
- Biggest SpenderEasy
- Bought and SoldEasy
- Busy SymbolsEasy
- Buyers per ProductEasy
- Customers Without OrdersEasy
- Low and HighEasy
- Net PositionEasy