FunctionRacerProblemsRace

Volume Weighted Price

MediumSQLSQLite

The volume weighted average price of a symbol is the money traded in it (the sum of qty times price) divided by the quantity traded (the sum of qty). Return each symbol once with vwap, rounded to 2 decimals. Rows may come in any order.

Example 1

trades
idsymbolqtyprice
1AAPL10190.0
2MSFT5410.0
3AAPL30194.0
returns
symbolvwap
AAPL193.0
MSFT410.0

Constraints

Race itor take your time

Write it in your browser, against the clock. The model query, with a note on each piece of it, comes after.

More SQL problems