Write a SQL query to find the average price of options traded in the last month.
Use the previous calendar month relative to CURRENT_DATE and exclude trades without a valid option contract or price.
average_price.| Column | Type | Description |
|---|---|---|
| trade_idPK | INT | Unique identifier for the trade |
| option_id | INT | Referenced option contract identifier |
| traded_at | TIMESTAMP | Timestamp when the option was traded |
| trade_price | NUMERIC(12,4) | Price paid for the option trade |
| Column | Type | Description |
|---|---|---|
| option_idPK | INT | Unique identifier for the option contract |
| option_symbol | VARCHAR(20) | Market symbol for the option |
| option_type | VARCHAR(4) | Option type, CALL or PUT |
| strike_price | NUMERIC(12,2) | Contract strike price |