Write a SQL query to identify the top N duplicate groups by count in a table.
For this exercise, use market_data_records and set N to 3. A duplicate group contains identical values across instrument_symbol, event_date, price, and quantity.
instrument_symbol, event_date, price, quantity, and duplicate_count.duplicate_count descending, then the grouping columns ascending with NULL values last.| Column | Type | Description |
|---|---|---|
| record_idPK | INT | Unique market data record identifier |
| instrument_symbol | VARCHAR(12) | Instrument symbol |
| event_date | DATE | Date associated with the market data event |
| price | NUMERIC(12,2) | Recorded instrument price |
| quantity | INT | Recorded contract quantity |