Public dataset · Web, code and analytics
TheLook Ecommerce in BigQuery
The thelook_ecommerce dataset is a fictitious online store with users, orders, order items, products, inventory and web events, all generated by a program and refreshed daily. At about 490 MiB in total it is a free sandbox for ecommerce SQL, joins and dashboards.
bigquery-public-data.thelook_ecommerce describes itself as a fictitious ecommerce dataset, and each table description says its rows are programmatically generated for The Look store. No row is a real person or order. All seven tables were last modified on the day these sizes were measured, so counts and totals change from one day to the next and will not match older tutorials.
The model is a small star schema. orders has one row per order with its status and timestamps, and order_items one row per item with sale_price, linked to products (with cost, category, brand and department) and to inventory_items. users holds customer profiles including country, traffic source and a GEOGRAPHY point, and events holds web sessions with event types such as cart and purchase. distribution_centers lists the 10 warehouses.
Tables and sizes
| Table | Rows | Size | Full scan | Layout |
|---|---|---|---|---|
eventsGenerated web events by session. | 2,431,475 | 368 MiB | under $0.01 | None |
inventory_itemsGenerated inventory, one row per item in stock or sold. | 490,530 | 77.6 MiB | under $0.01 | None |
usersGenerated customers. | 100,000 | 18.9 MiB | under $0.01 | None |
order_itemsGenerated order lines with sale price. | 181,719 | 13.0 MiB | under $0.01 | None |
ordersGenerated orders. | 125,042 | 6.4 MiB | under $0.01 | None |
productsProduct catalog with cost and retail price. | 29,120 | 4.1 MiB | under $0.01 | None |
distribution_centersWarehouses with coordinates. | 10 | 809 B | under $0.01 | None |
Example queries
Monthly orders and revenue
Revenue from order_items, excluding cancelled and returned items.
SELECT
DATE_TRUNC(DATE(created_at), MONTH) AS month,
COUNT(DISTINCT order_id) AS orders,
ROUND(SUM(sale_price), 2) AS revenue
FROM `bigquery-public-data.thelook_ecommerce.order_items`
WHERE status NOT IN ('Cancelled', 'Returned')
GROUP BY month
ORDER BY month;Revenue and gross margin by product category
Joins order items to products for the unit cost. The scan is about 5 MiB, but BigQuery bills at least 10 MB for each table referenced, so this query bills 20 MB.
SELECT
p.category,
ROUND(SUM(oi.sale_price), 2) AS revenue,
ROUND(SUM(oi.sale_price - p.cost), 2) AS gross_margin
FROM `bigquery-public-data.thelook_ecommerce.order_items` AS oi
JOIN `bigquery-public-data.thelook_ecommerce.products` AS p
ON oi.product_id = p.id
WHERE oi.status = 'Complete'
GROUP BY p.category
ORDER BY revenue DESC;Cart and purchase sessions by traffic source
The most expensive query here, because events is the largest table, and still only 128 MiB.
SELECT
traffic_source,
COUNT(DISTINCT session_id) AS sessions,
COUNT(DISTINCT IF(event_type = 'cart', session_id, NULL)) AS with_cart,
COUNT(DISTINCT IF(event_type = 'purchase', session_id, NULL)) AS with_purchase
FROM `bigquery-public-data.thelook_ecommerce.events`
GROUP BY traffic_source
ORDER BY sessions DESC;Orders and buyers by country
SELECT
u.country,
COUNT(DISTINCT o.user_id) AS buyers,
COUNT(*) AS orders
FROM `bigquery-public-data.thelook_ecommerce.orders` AS o
JOIN `bigquery-public-data.thelook_ecommerce.users` AS u
ON o.user_id = u.id
GROUP BY u.country
ORDER BY orders DESC;Querying it cheaply
- The whole dataset is about 490 MiB.
eventsis three quarters of it; the order tables are a few MiB each. - BigQuery bills at least 10 MB per table referenced and per query, so a join of three small tables bills 30 MB even if it reads less.
- Because the data is regenerated daily, query results are cached only until the next refresh.
- If you build a dashboard on it, point the dashboard at a summary table you refresh yourself, not at raw
events.
FAQ
How much does it cost to query thelook_ecommerce?
Almost nothing. Most queries read a few MiB and bill the 10 MB minimum per table. Even reading every column of every table is about 490 MiB, a small fraction of the free 1 TiB a month.
Is the thelook_ecommerce dataset free?
Yes for storage: the data sits in the bigquery-public-data project and Google pays to store it. You pay for the queries you run from your own project. On-demand, the first 1 TiB scanned each month is free, then you pay per TiB scanned (see BigQuery pricing).
Is thelook_ecommerce real data?
No. The dataset description calls it fictitious, and the table descriptions say the rows are programmatically generated. Use it for learning SQL, modeling and dashboards, not for market research.
Why do my thelook_ecommerce results differ from a tutorial?
The tables are regenerated daily: all of them were last modified on the day these sizes were measured. Order counts and revenue shift with every refresh, so totals from a tutorial written earlier will not match.
Related datasets
All public datasets · BigQuery cost queries · Pricing calculator
