Public
Edited
Apr 4, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
pizzeriaDB
SELECT orderDate::date as "orderDate"
, date_part('dayofweek', orderDate::date) as day_of_week
, sum(nItems::int)::int as totalItems
, sum(total::int)::int as revenue
FROM orders
GROUP BY 1, 2
Insert cell
Insert cell
Insert cell
pizzeriaDB
SELECT orderDate::date as "orderDate"
, date_part('dayofweek', orderDate::date) as day_of_week
, products.Category
, products.Name || ' ' || products.Size as "name"
, max(products.Price)::int as price
, count(distinct orders.id) as orders
, sum(products.Price::int)::int as "total"
FROM orders
JOIN order_items
ON orders.id = order_items.orderID
JOIN products
ON order_items.SKU = products.SKU
GROUP BY 1, 2, 3, 4
Insert cell
Insert cell
Insert cell
pizzeriaDB
SELECT c.longitude as longitude
, c.latitude as latitude
, c.id as customerId
, o.storeId as storeId
, COUNT(*) as orders
FROM orders as o
JOIN customers as c
ON o.customerId = c.id
GROUP BY 1, 2, 3, 4
Insert cell
pizzeriaDB
select * from stores
Insert cell
Insert cell
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