SQLQuokka
Start practicing
QuestionsLearnSandboxFeaturesRoadmapFAQ

Units Sold per Department

Unsolved

Amazon's category managers want a units-sold report by department. Every department must appear, even if none of its products have sold, in which case it shows 0. Units come from order_items.quantity. Write an SQL query that returns department_name and units_sold. Order the results by units_sold descending, then department_name ascending.

SQL Query Editor (Ctrl+Enter to run)
0 characters · Valid
Canonical Solution Official

Official Solution is Hidden

Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.

Community Q&A & Discussion

Ask questions, share alternate queries, and explore solutions

0 comments
Asked By:
🏢 Amazon

Submission History

Your recent query executions and answer checks

Execution Pipeline:
FROM departments
Full source dataset
4 rows total
Ready. Type a query to see live execution.
Clause: Auto-Sync · AlaSQL Engine