Public
Edited
Jun 2, 2023
Insert cell
Insert cell
Insert cell
Insert cell
import { pizzeriaDB } from '@observablehq/pizza-paradise-data'
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
whereIHaveLived = [
{location: "Long Island", date: "2000-01-01"},
{location: "Poughkeepsie", date: "2005-09-01"},
{location: "Prague", date: "2007-09-01"},
{location: "Poughkeepsie", date: "2008-01-01"},
{location: "Brooklyn", date: "2009-06-01"},
{location: "Boulder", date: "2011-08-01"},
{location: "Brooklyn", date: "2013-04-01"},
{location: "Boulder", date: "2019-12-01"},
]
Insert cell
whereIHaveLived
SELECT * FROM whereIHaveLived
Insert cell
Insert cell
Insert cell
pizzeriaDB
SELECT stores.* FROM stores LIMIT 10
Insert cell
Insert cell
Insert cell
pizzeriaDB
SELECT city
, state
, zipcode
FROM stores
Insert cell
Insert cell
Select a data source…
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
pizzeriaDB
SELECT DISTINCT state
FROM stores
Insert cell
Insert cell
pizzeriaDB
SELECT DISTINCT state
, city
FROM stores
Insert cell
Insert cell
Insert cell
pizzeriaDB
SELECT state
, count(*) as "Number of Stores"
FROM stores
GROUP BY state
Insert cell
Insert cell
pizzeriaDB
SELECT count(*) as numStores
FROM stores
Insert cell
pizzeriaDB
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
pizzeriaDB
SELECT count(*) as numOrders FROM orders
Insert cell
pizzeriaDB
SELECT count(distinct state) as numStates FROM stores
Insert cell
Insert cell
pizzeriaDB
SELECT category
, avg(price) as avgProdPrice
, count(*) as numProducts
FROM products
GROUP BY category
Insert cell
Insert cell
pizzeriaDB
SELECT category
, count(DISTINCT price) as distinctProdPrice
FROM products
GROUP BY category
Insert cell
Insert cell
pizzeriaDB
SELECT category
, "size"
, avg(price) as avgProdPrice
, count(*) as numProducts
FROM products
GROUP BY category
, "size"
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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