Point72's trading analytics team wants to monitor unusual daily activity by ticker. Write a PostgreSQL query that aggregates trade volume by ticker and trading date, then compares each day with the prior seven completed trading observations.
trades to active securities only and aggregate total volume per ticker and date.false when the baseline is not yet available.| Column | Type | Description |
|---|---|---|
| trade_idPK | INT | Unique trade identifier |
| ticker | VARCHAR(10) | Ticker symbol referenced by securities |
| trade_date | DATE | Date on which the trade occurred |
| volume | INT | Number of shares traded |
| Column | Type | Description |
|---|---|---|
| tickerPK | VARCHAR(10) | Security ticker symbol |
| security_name | VARCHAR(100) | Security display name |
| is_active | BOOLEAN | Whether the security is actively monitored |