Tesla
Foundations Track · Easy · 15 min
Top Product By Category
Tesla is reviewing top product by category through a trend check. Return the highest-grossing product_id in each category during June 2024 along with categor...
Company labels are directional practice context, not official interview guidance.
Objective
Practice query basics through a Tesla-tagged business scenario.
Approach
Use this track to lock in clean query structure, basic filtering logic, and confidence with grouped output.
Company context
Company labels are directional practice context, not official interview guidance.
Tesla is reviewing top product by category through a trend check. Return the highest-grossing product_id in each category during June 2024 along with category and total_revenue. Sort by category.
order_items
| order_id | category | |||
|---|---|---|---|---|
| 1 | Home | 501 | 120 | 2024-06-01 |
| 2 | Home | 501 | 100 | 2024-06-03 |
| 3 | Home | 502 | 300 | 2024-06-04 |
| 4 | Tech | 601 | 200 | 2024-06-02 |
| 5 | Tech | 602 | 250 | 2024-06-03 |
| 6 | Tech | 602 | 200 | 2024-06-05 |
| 7 | Beauty | 701 | 90 | 2024-06-06 |
| 8 | Beauty | 702 | 70 | 2024-06-07 |
SQL workspace
Run queries against the protected question data, then submit once the result shape looks right.
Sign in to run SQL
Create a free account or sign in before running queries against protected question data.