The most fundamental Amazon business question โ answered with clean data from your order_items table, properly excluding cancellations and NULL-priced items.
The question
The SQL Taptic generates
SELECT TO_CHAR(DATE_TRUNC('month', o.purchase_date::timestamptz), 'YYYY-MM') AS order_month, COUNT(DISTINCT o.amazon_order_id) AS total_orders, SUM(i.quantity) AS units_sold, ROUND(SUM(i.item_price * i.quantity), 2) AS gross_revenue, ROUND(SUM(i.item_price * i.quantity) / NULLIF(COUNT(DISTINCT o.amazon_order_id), 0), 2) AS avg_order_value FROM amazon_orders o JOIN amazon_order_items i ON i.amazon_order_id = o.amazon_order_id WHERE o.order_status NOT IN ('Canceled', 'Cancelled') AND i.item_price IS NOT NULL AND o.purchase_date::timestamptz >= NOW() - INTERVAL '12 months' GROUP BY DATE_TRUNC('month', o.purchase_date::timestamptz) ORDER BY 1 ASC
This query was generated by Taptic Data from plain English against a real Amazon Seller Central schema. In Taptic, you type the question โ the AI writes the SQL, runs it, and returns the result. You can edit the SQL, ask for explanations, and save it as a refreshable report.
How this query works
What it returns
A month-by-month table of orders, units sold, gross revenue, and average order value โ covering the last 12 months in chronological order, ready to chart as a line or bar.
Why it matters
Generate this automatically
In Taptic Data, you type "Show me total Amazon revenue by month for the last 12 months..." and this SQL runs automatically against your real Amazon Seller Central data.
Try Taptic Free โ $29.99/moNo credit card required. Connect your data source in under 5 minutes.