Skip to main content
Use the same query standards from the SQL Query Library overview: is_order_sm_valid = TRUE for order analyses, sm_store_id scoping for multi-store setups, and your_project placeholders.
What you’ll learn: Your highest revenue-generating products with units sold and order counts. Use this to identify your cash cows and prioritize inventory, marketing, and merchandising decisions.
What you’ll learn: Your most popular products by volume, which may differ from your top revenue generators. Useful for forecasting demand, managing inventory levels, and identifying viral or gateway products.
What you’ll learn: Which products are most often the entry point for new customers. These “gateway products” are key to acquisition strategy—consider featuring them in ads, bundles, or welcome offers.
What you’ll learn: Which products are frequently purchased together in the same order. Use this for bundle recommendations, cross-sell strategies, and merchandising decisions.

What you’ll learn: Current available units per product variant across all physical, trusted Shopify locations. Use is_inventory_default_total_eligible = TRUE to get a conservative, safe total — this excludes unmatched, untrusted, and non-physical rows.
What you’ll learn: Products with zero or negative available inventory across trusted Shopify locations. Negative values are oversold/backordered positions — they are preserved as-is from the source.
What you’ll learn: How your available inventory is distributed across warehouses, fulfillment services, and other location types. Useful for spotting over-concentration in a single node.
What you’ll learn: Which products have low available inventory relative to recent sales velocity. This uses trusted current inventory and valid order lines from the last 30 days to estimate days of supply.
Back to the SQL Query Library.

Orders & Revenue

Tie product-level insights to topline revenue mix.

Customers & Retention

Understand product performance by customer lifecycle stage.

LTV & Retention

Connect gateway products to long-term cohort value.