Public
Edited
May 31, 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 location FROM whereIHaveLived
Insert cell
Insert cell
Insert cell
pizzeriaDB
SELECT * FROM stores
Insert cell
Insert cell
Insert cell
pizzeriaDB
SELECT city
, zipcode
, state
FROM stores
Insert cell
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 num_stores
FROM stores
GROUP BY state
Insert cell
Insert cell
pizzeriaDB
SELECT count(*) as num_stores
FROM stores
Insert cell
pizzeriaDB
SELECT count(distinct state) as num_stores
FROM stores
Insert cell
Insert cell
pizzeriaDB
SELECT count(*) as num_products
FROM products
Insert cell
Insert cell
pizzeriaDB
SELECT Category
, avg(Price) as avg_price
, count(*) as num_products
FROM products
GROUP BY Category
Insert cell
Insert cell
pizzeriaDB
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
pizzeriaDB
SELECT Category
, "Size"
, avg(Price) as avg_price
, count(*) as num_products
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