Public
Edited
Mar 6, 2023
Insert cell
Insert cell
Insert cell
Insert cell
focusPNRRdb = DuckDBClient.of({
pnrr: FileAttachment("opencup_focus_pnrr.parquet")
})
Insert cell
focusPNRRdb
SELECT * FROM pnrr USING SAMPLE 10%
Insert cell
gaiadb = DuckDBClient.of({
gaia: FileAttachment("gaia-sample.arrow")
})
Insert cell
Insert cell
Insert cell
gaiadb
SELECT * FROM gaia USING SAMPLE 10%
Insert cell
focusPNRRdb
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
stars // the results of the SQL query above
Insert cell
stars[0] // the first row
Insert cell
stars[0].ra // the ra (right ascension) field of the first row
Insert cell
Insert cell
stocks = DuckDBClient.of({
aapl: FileAttachment("aapl.csv"),
amzn: FileAttachment("amzn.csv"),
goog: FileAttachment("goog.csv"),
ibm: FileAttachment("ibm.csv")
})
Insert cell
stocks
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
moviesdb = DuckDBClient.of({
movies: {
file: FileAttachment("movies.csv"),
dateFormat: "%b %d %Y" // e.g. Jun 12 1998
}
})
Insert cell
moviesdb
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
stocks.sql`SELECT Open, Close, Volume FROM aapl WHERE Volume > ${100_000_000}`
Insert cell
stocks.query("SELECT Open, Close, Volume FROM aapl WHERE Volume > ?", [100_000_000])
Insert cell
Insert cell
maxaapl = stocks.queryRow("SELECT Date, Open, Close, Volume FROM aapl ORDER BY Volume DESC LIMIT 1")
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