SQL: delete duplicate rows from a table
Asked in the R1 stage. Treat rows with identical inventory attributes as duplicates, retaining the row with the smallest id.
inventory_snapshots.id, store_id, sku, inventory_date, quantity, and status.id.| Column | Type | Description |
|---|---|---|
| idPK | INT | Unique inventory snapshot identifier |
| store_id | INT | Walmart store identifier |
| sku | VARCHAR(20) | Stock keeping unit |
| inventory_date | DATE | Date of the inventory snapshot |
| quantity | INT | Recorded inventory quantity |
| status | VARCHAR(20) | Inventory availability status |