Public
Edited
Jun 13, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
pizzeriaDB
SELECT products.name
, products.size
, count(distinct orders.id) as numOrders
FROM order_items
JOIN orders
ON order_items.orderID = orders.Id
JOIN products
ON order_items.SKU = products.SKU
GROUP BY products.name, products.size
ORDER BY numOrders DESC
Insert cell
Insert cell
pizzeriaDB
SELECT name
, count(distinct orders) as numOrders
, avg(orders) as avgOrders
, min(orders) as minOrders
, max(orders) as maxOrders
, median(orders) as medianOrders
, mode(orders) as modeOrders
FROM orders_by_product_day
GROUP BY 1,
ORDER BY avgOrders DESC


Insert cell
Insert cell
Insert cell
pizzeriaDB
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
pizzeriaDB
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
pizzeriaDB
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
pizzeriaDB
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Select a data source…
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
pizzeriaDB
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
pizzeriaDB
SELECT DISTINCT case when stores.state = 'Utah' then true else false end as isUtah
, orders.orderDate::date as order_date
, count(distinct orders.id) as num_orders
FROM products
LEFT JOIN order_items
ON products.SKU = order_items.SKU
LEFT JOIN orders
ON order_items.orderId = orders.id
LEFT JOIN stores
ON orders.storeId = stores.id
WHERE products.name like '%Hawaiian%'
GROUP BY 1, 2
HAVING isUtah = true
Insert cell
Insert cell
pizzeriaDB
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more