Your question is Top 10 Products SQL Query. Start with the requirements and the one table 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.
Artefact's commerce analytics team needs a monthly view of its strongest-selling products. Write a PostgreSQL query using the product_sales table to find the top 10 products by total sales during the previous calendar month. For the sample data, assume the current date is 2026-08-29, so the reporting period is July 2026.
product_name, calculate total sales, sort from highest to lowest, and return at most 10 products.| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique identifier for the sale |
| product_name | VARCHAR(100) | Name of the product sold |
| sale_date | DATE | Calendar date on which the sale occurred |
| sale_amount | NUMERIC(12,2) | Revenue attributed to the sale |