In SQL, what is the difference between GROUP BY and PARTITION BY?
Explain the distinction and demonstrate both behaviors using the supplied PostgreSQL table. Return one row per venue and trading date, including daily totals and the venue total repeated for each date.
venue, trade_date, daily_notional, daily_trade_count, and venue_total_notional.venue ascending with NULL venues last, then trade_date ascending.| Column | Type | Description |
|---|---|---|
| trade_idPK | INT | Unique trade identifier |
| venue | VARCHAR(50) | Trading venue associated with the trade |
| trade_date | DATE | Calendar date on which the trade occurred |
| notional | NUMERIC(12,2) | Trade notional amount |