AI Generated SQL
SELECT
p.category,
SUM(s.total_amount) AS total_revenue
FROM sales_orders s
JOIN products p ON p.product_id = s.id
WHERE s.order_date >= DATE_TRUNC('month', CURRENT_DATE)
GROUP BY p.category
ORDER BY total_revenue DESC; Result
| category | total_revenue |
|---|---|
| Electronics | R3,450,230 |
| Home Appliances | R2,810,450 |
| Computers | R1,650,120 |
| Accessories | R2,514,680 |
| Other | R1,245,220 |
AI Summary
Electronics is the top performing category this month with R3.45M in total revenue, contributing 32% of total sales.
Create Dashboard