Homeโ€บQuery Libraryโ€บeCommerce

Which SKUs sell on both Amazon and Shopify โ€” and where do they perform better?

If you sell the same products on both channels, you need to know which channel is more profitable for each SKU. This query finds overlapping SKUs and compares revenue, units, and margins side by side.

๐Ÿ“Š Amazon Seller Central + Shopify๐Ÿ‘ฅ Multi-channel eCommerce sellers๐Ÿ”ค Plain-English โ†’ SQL

This is part of the Taptic Data eCommerce query library. Explore related queries: SQL query for Amazon revenue by month, SQL query for Shopify revenue by month, and more.

Show me SKUs that sell on both Amazon and Shopify with revenue and units compared
โ†“
Amazon + Shopify SKU Overlap Analysis โ€” generated by Taptic Data AI
WITH amazon_skus AS (
  SELECT
    i.sku,
    SUM(i.item_price * i.quantity)    AS amazon_revenue,
    SUM(i.quantity)                   AS amazon_units,
    COUNT(DISTINCT o.amazon_order_id) AS amazon_orders
  FROM amazon_order_items i
  JOIN amazon_orders o ON o.amazon_order_id = i.amazon_order_id
  WHERE o.order_status NOT IN ('Canceled', 'Cancelled')
    AND i.item_price IS NOT NULL
    AND o.purchase_date::date >= CURRENT_DATE - INTERVAL '90 days'
  GROUP BY i.sku
),
shopify_skus AS (
  SELECT
    li.sku,
    SUM(li.price * li.quantity)       AS shopify_revenue,
    SUM(li.quantity)                  AS shopify_units,
    COUNT(DISTINCT li.order_id)       AS shopify_orders
  FROM shopify_order_line_items li
  JOIN shopify_orders o ON o.id = li.order_id
  WHERE o.financial_status IN ('paid', 'partially_refunded')
    AND o.cancelled_at IS NULL
    AND o.created_at >= NOW() - INTERVAL '90 days'
  GROUP BY li.sku
)
SELECT
  COALESCE(a.sku, s.sku)             AS sku,
  ROUND(COALESCE(a.amazon_revenue, 0)::numeric, 2) AS amazon_revenue,
  COALESCE(a.amazon_units, 0)        AS amazon_units,
  ROUND(COALESCE(s.shopify_revenue, 0)::numeric, 2) AS shopify_revenue,
  COALESCE(s.shopify_units, 0)       AS shopify_units,
  ROUND((COALESCE(a.amazon_revenue, 0) + COALESCE(s.shopify_revenue, 0))::numeric, 2) AS combined_revenue,
  CASE
    WHEN a.sku IS NOT NULL AND s.sku IS NOT NULL THEN 'Both'
    WHEN a.sku IS NOT NULL THEN 'Amazon only'
    ELSE 'Shopify only'
  END                                AS channel_status
FROM amazon_skus a
FULL OUTER JOIN shopify_skus s ON s.sku = a.sku
ORDER BY combined_revenue DESC
LIMIT 50
Schema-aware SQL generated from plain English42 lines

This query was generated by Taptic Data from plain English against a real Amazon Seller Central + Shopify 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.

Breaking it down line by line

  1. CTE "amazon_skus" aggregates revenue and units per SKU from Amazon orders in the last 90 days
  2. CTE "shopify_skus" does the same from Shopify order line items
  3. FULL OUTER JOIN ensures SKUs selling on only one channel still appear in results
  4. channel_status column categorizes each SKU as Both, Amazon only, or Shopify only
  5. Combined revenue lets you see total business value per SKU across channels

Result description

SKU-level revenue and unit comparison across Amazon and Shopify, with channel overlap status and combined revenue.

The business impact

SKU overlap analysis reveals channel-specific performance differences. A SKU doing $50K on Amazon and $5K on Shopify might benefit from increased Shopify marketing. A SKU doing well on Shopify but poorly on Amazon might have a listing or pricing issue. You can only see this with a side-by-side view.

Common questions

How do I generate a "Amazon + Shopify SKU Overlap Analysis" query automatically?
In Taptic Data, type "Show me SKUs that sell on both Amazon and Shopify with revenue and units compared" and the AI generates schema-aware SQL against your real Amazon Seller Central + Shopify data โ€” no manual writing required.
What database does this query work with?
This query is designed for Amazon Seller Central + Shopify. Taptic reads your live schema so the generated SQL always matches your actual table and column names.
Can I edit the generated SQL?
Yes. Taptic shows you the exact SQL it generated. You can edit it directly, ask the AI to explain any line, or request a revision in plain English.
Can I save this as a scheduled report?
Yes. Once you run this query in Taptic, you can save it as a report, add charts and KPIs, and schedule it to email your team on any cadence โ€” daily, weekly, or monthly.

Skip the SQL. Ask the question.

In Taptic Data, you type "Show me SKUs that sell on both Amazon and Shopify with reven..." and this SQL runs automatically against your real Amazon Seller Central + Shopify data.

Try Taptic Free โ€” $29.99/mo

No credit card required. Connect your data source in under 5 minutes.