Your question is Joining Tables With Sales Filters. 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.
HARMAN's Business Analytics team wants a quarterly view of qualifying North American sales across JBL, Harman Kardon, and related product lines. Write a PostgreSQL query that joins orders, order items, and products to identify products meeting the specified sales criteria.
Completed between 2025-01-01 and 2025-03-31.Audio category.CASE, and sort by net revenue descending.| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique sales order identifier |
| order_date | DATE | Date the order was placed |
| region | VARCHAR(50) | Geographic sales region |
| status | VARCHAR(20) | Order processing status |
| Column | Type | Description |
|---|---|---|
| item_idPK | INT | Unique order item identifier |
| order_id | INT | References sales_orders.order_id |
| product_id | INT | References products.product_id |
| quantity | INT | Number of units sold |
| unit_price | NUMERIC(10,2) | Price per unit before discount |
| discount_percent | NUMERIC(5,2) | Discount percentage applied to the item |
| Column | Type | Description |
|---|---|---|
| product_idPK | INT | Unique HARMAN product identifier |
| product_name | VARCHAR(150) | HARMAN product name |
| category | VARCHAR(50) | Product category |