Your question is SQL Top 10 Selling Cars. Start with the requirements and the three tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
CarGurus wants to identify the vehicle models with the highest number of completed sales through its marketplace. Write a PostgreSQL query to return the top 10 models sold during 2025.
| Column | Type | Description |
|---|---|---|
| model_idPK | INT | Unique vehicle model identifier |
| make | VARCHAR(50) | Vehicle manufacturer |
| model | VARCHAR(80) | Vehicle model name |
| trim | VARCHAR(80) | Vehicle trim designation |
| Column | Type | Description |
|---|---|---|
| listing_idPK | INT | Unique vehicle listing identifier |
| model_id | INT | Referenced vehicle model |
| marketplace | VARCHAR(40) | Marketplace associated with the listing |
| listing_status | VARCHAR(20) | Current listing status |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sale identifier |
| listing_id | INT | Referenced vehicle listing |
| sold_at | DATE | Date on which the vehicle was sold |
| sale_status | VARCHAR(20) | Outcome of the sale transaction |
| sale_price | NUMERIC(10,2) | Final transaction price |