Can you write a SQL query to find the total sales for each product category at Lloyd’s Market?
Use the provided category, product, and sales tables. Include categories with no matching sales and treat missing sale amounts as contributing zero.
category_name and total_sales.total_sales descending, then category_name ascending for ties.| Column | Type | Description |
|---|---|---|
| category_idPK | INT | Unique product category identifier |
| category_name | VARCHAR(100) | Product category name |
| Column | Type | Description |
|---|---|---|
| product_idPK | INT | Unique product identifier |
| product_name | VARCHAR(150) | Product name |
| category_id | INT | Product category identifier |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sale identifier |
| product_id | INT | Sold product identifier |
| sale_amount | NUMERIC(12,2) | Recorded sale amount |