Public
Edited
Jun 4, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
whereIHaveLived = [
{ location: "Long Island, New York", 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 * 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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more