Public
Edited
Feb 7, 2023
Insert cell
Insert cell
client
SELECT * FROM stock LIMIT 10
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
client
SELECT trip_id, pickup_datetime FROM trips
Insert cell
Insert cell
Insert cell
client
SELECT pickup_datetime FROM trips
Insert cell
Insert cell
client
SELECT trip_id, trip_distance, fare_amount FROM trips
Insert cell
Insert cell
client
SELECT * FROM trips
Insert cell
Insert cell
client
SELECT * EXCEPT (trip_id, vendor_id) FROM trips
Insert cell
Insert cell
Insert cell
client
SELECT * FROM menu_item_denorm
Insert cell
Insert cell
client
SELECT
cab_type, pickup_datetime, trip_distance, fare_amount
FROM trips WHERE
(cab_type = 'yellow') AND
(pickup_datetime < '2015-01-01')
Insert cell
Insert cell
client
SELECT
fare_amount, dropoff_ntacode, cab_type, trip_distance
FROM trips
WHERE
fare_amount BETWEEN 2 AND 9 AND
(dropoff_ntacode LIKE '_N%') AND (dropoff_ntacode LIKE 'M%')
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
client
SELECT mta_tax, passenger_count FROM trips WHERE mta_tax != 0
Insert cell
Insert cell
client
SELECT trip_id, payment_type_, dropoff_ntacode FROM trips WHERE payment_type_ = 'CRE' AND dropoff_ntacode LIKE '%2'
Insert cell
Insert cell
client
SELECT trip_id, trip_id AS id, vendor_id AS vendor FROM trips;
Insert cell
Insert cell
client
SELECT DISTINCT cab_type FROM trips;
Insert cell
Insert cell
Insert cell
Insert cell
client
SELECT DISTINCT payment_type_ FROM trips
Insert cell
Insert cell
client
SELECT dish_name, price FROM menu_item_denorm
ORDER BY price DESC, dish_name ASC
Insert cell
Insert cell
Insert cell
Insert cell
client
SELECT created_at, dish_name FROM menu_item_denorm ORDER BY created_at DESC
Insert cell
Insert cell
client
SELECT * FROM trips LIMIT 5
Insert cell
Insert cell
client
SELECT * FROM trips LIMIT 5 OFFSET 3
Insert cell
Insert cell
Insert cell
Insert cell
client
SELECT trip_id FROM trips LIMIT 3
Insert cell
Insert cell
client
SELECT
dish_name,
price
FROM menu_item_denorm
ORDER BY price DESC
LIMIT 5

UNION ALL

SELECT
dish_name,
price
FROM menu_item_denorm
ORDER BY price ASC
LIMIT 5
Insert cell
Insert cell
Insert cell
client
DESCRIBE TABLE recipes
Insert cell
Insert cell
client
SHOW TABLES
Insert cell
client
SHOW DATABASES
Insert cell
Insert cell
client
SELECT
rand(0) AS a,
rand(1) AS b,
a + b AS added,
a - b AS subtracted,
a * b AS multiplied,
a / b AS divided,
a % b AS moded,
abs(subtracted)
FROM numbers(10);
Insert cell
client
SELECT
rand(0) AS a,
rand(1) AS b,
a > b AS gt,
a < b AS lt,
a = b AS eq,
a != b AS ne
FROM numbers(10);
Insert cell
Insert cell
Insert cell
Insert cell
client
SELECT
dish_name,
dish_highest_price - dish_lowest_price AS range
FROM menu_item_denorm
WHERE dish_highest_price > 0 AND dish_lowest_price > 0
ORDER BY menu_id, dish_id
LIMIT 1000
Insert cell
Insert cell
client
SELECT
title,
source,
length(title),
concat(source, '-', trim(title)),
lower(title) LIKE '%chocolate%'
FROM recipes
Insert cell
Insert cell
Insert cell
Insert cell
client
SELECT
concat('https://', link) AS answer
FROM recipes
Insert cell
Insert cell
client
SELECT
now(),
today(),
dateDiff('hour', yesterday(), today()) AS hrs_btn_td_ytd,
today() + INTERVAL 1 day AS tomorrow,
today() - INTERVAL 1 year AS yester_year,
formatDateTime(now(), '%D at %I:%M:%S %p', 'EST')
Insert cell
Insert cell
Insert cell
Insert cell
client
SELECT
CAST(1234 AS String) AS my_string,
CAST('1970-01-01' AS Date) AS my_date,
CAST('1899-01-01' AS Date) AS my_wrong_date,
CAST(0 AS BOOLEAN) AS my_false,
CAST(1 AS BOOLEAN) AS my_true

Insert cell
Insert cell
Insert cell
Insert cell
client
SELECT number FROM numbers(10)
Insert cell
Insert cell
client
SELECT
title,
length(ingredients) > 3 ? 'four or more ingredients' : 'three or less ingredients' AS category,
CASE source
WHEN 'Gathered' THEN true
ELSE false
END AS was_gathered
FROM recipes;
Insert cell
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