Trade Value
The value of a trade is its quantity times its price. Return the id of every trade and its value. Rows may come in any order.
Example 1
trades
| id | symbol | qty | price |
|---|---|---|---|
| 1 | AAPL | 10 | 190.5 |
| 2 | MSFT | 5 | 410.0 |
| 3 | KO | 300 | 61.25 |
returns
| id | value |
|---|---|
| 1 | 1905.0 |
| 2 | 2050.0 |
| 3 | 18375.0 |
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
- Two ColumnsBeginner
- Average per SymbolEasy
- Biggest SpenderEasy
- Bought and SoldEasy
- Busy SymbolsEasy
- Buyers per ProductEasy
- Customers Without OrdersEasy
- Low and HighEasy