---
title: "ShopifyQL Notebooks: Simplifying Querying with Commerce Data Models"
description: "Shopify built commerce data models behind ShopifyQL Notebooks so merchants can query metrics like sales and view-to-purchase conversion without SQL or joining across departmental datasets."
url: "https://swe.quest/articles/shopifyql-notebooks-simplifying-querying-with-commerce-data-models-518ab97f2ab79e6a"
canonical: "https://shopify.engineering/building-commerce-data-models-with-shopifyql"
source: "Shopify Engineering"
published: "2023-02-14"
difficulty: "medium"
kind: "Case study"
reading_minutes: 11
tags: ["analytics","data-pipelines","ecommerce","performance"]
---

# ShopifyQL Notebooks: Simplifying Querying with Commerce Data Models

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2023-02-14, 11 min read, Case study. Original: [https://shopify.engineering/building-commerce-data-models-with-shopifyql](https://shopify.engineering/building-commerce-data-models-with-shopifyql)

## Summary

Shopify built commerce data models behind ShopifyQL Notebooks so merchants can query metrics like sales and view-to-purchase conversion without SQL or joining across departmental datasets. Good models are purpose-driven, explorable (right granularity, useful dimensions, fully additive metrics rather than semi- or non-additive ones) and extensible. The process runs from business questions to mock data and template queries, then to sourcing upstream tables, checking quality and consistency, and deriving freshness from upstream SLOs. Build time improved by switching from full-drop to incremental pipelines, at some cost in maintainability, and query speed improved with daily per-product roll-up tables for high-cardinality GROUP BYs.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Data pipelines](https://swe.quest/tags/data-pipelines.md) (Data & databases)
- [E-commerce](https://swe.quest/tags/ecommerce.md) (Domains)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- data warehousing basics
- SQL aggregation ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))

## Keywords

ShopifyQL, ShopifyQL Notebooks, Shopify, BigQuery, Trino

## Related posts

- [Introducing ShopifyQL: Our New Commerce Data Querying Language](https://swe.quest/articles/introducing-shopifyql-our-new-commerce-data-querying-language-ffb625f9afa12468.md): Shopify Engineering · 2022-06-22 · Easy · 11 min read · Analytics & OLAP, Language design, SQL, E-commerce
  ShopifyQL is a commerce-focused query language for Shopify Plus merchants that reorders SQL-like syntax (FROM before SHOW, BY instead of GROUP BY) and adds VISUALIZE for direct charting, COMPARE TO for period-over-period analysis without joins or window functions, and DURING for named commerce date ranges like BFCM.
- [How Shopify Built An In-Context Analytics Experience](https://swe.quest/articles/how-shopify-built-an-in-context-analytics-experience-bced6498ed610bad.md): Shopify Engineering · 2021-05-25 · Medium · 14 min read · Analytics & OLAP, Data pipelines, Product engineering, Stream processing, E-commerce
  Shopify embedded order and fulfillment metrics directly into the admin Orders page instead of keeping them in a separate Analytics section, after research showed merchants bouncing between pages to make decisions.
- [The Complex Data Models Behind Shopify's Tax Insights Feature](https://swe.quest/articles/the-complex-data-models-behind-shopify-s-tax-insights-feature-49623cc993d19aef.md): Shopify Engineering · 2023-02-08 · Medium · 11 min read · Data pipelines, Analytics & OLAP, SQL, Python
  Shopify's Tax Insights feature tells US merchants when they reach sales-tax economic nexus in each state.
- [A modern data stack for startups](https://swe.quest/articles/a-modern-data-stack-for-startups-20644b674a9fc96e.md): incident.io · 2022-01-25 · Medium · 15 min read · Data pipelines, Analytics & OLAP, PostgreSQL
  A small startup data stack built in two weeks: Fivetran (plus Stitch for connectors Fivetran lacks, like the Close CRM) extracts data into BigQuery, dbt transforms it, and Metabase lets non-engineers explore it without SQL.
- [Retail data, reimagined: How Increff rebuilt its BI platform with ClickHouse](https://swe.quest/articles/retail-data-reimagined-how-increff-rebuilt-its-bi-platform-with-clickhouse-9614303cc823e283.md): ClickHouse · 2025-01-14 · Medium · 4 min read · Analytics & OLAP, Databases, Performance engineering
  Increff, a retail SaaS provider for brands like Puma and Adidas, replaced a BI stack of Pandas transformations, a serverless SQL warehouse and Superset after a client with 5x larger data caused query slowdowns and concurrency limits.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
