Your question is SQL for Market Metrics. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Write a SQL query to analyze market data and summarize key metrics by product and date.
Use the provided products and market_data tables. Include only records associated with a known product, and preserve rows even when nullable market values affect individual metrics.
product_id, product_name, market_date, trade_count, priced_trade_count, total_volume, avg_price, high_price, low_price, and vwap.product_name, then market_date, then product_id.| Column | Type | Description |
|---|---|---|
| product_idPK | INT | Unique market product identifier |
| product_name | VARCHAR(100) | Market product name |
| asset_class | VARCHAR(50) | Product asset class |
| Column | Type | Description |
|---|---|---|
| market_data_idPK | INT | Unique market observation identifier |
| product_id | INT | Referenced market product identifier |
| market_date | DATE | Date of the market observation |
| price | NUMERIC(18,4) | Observed market price |
| volume | NUMERIC(20,2) | Observed traded volume |