Public
Edited
Feb 14, 2023
Insert cell
Insert cell
Insert cell
Insert cell
client
SELECT
TRUE AND FALSE AND FALSE OR TRUE AS without_parens,
((TRUE AND FALSE) AND FALSE) OR TRUE AS and_precedence,
((TRUE AND FALSE) AND FALSE) OR TRUE AS l2r_and_precedence,
(TRUE AND FALSE) AND (FALSE OR TRUE) AS grouped,
TRUE AND (FALSE AND (FALSE OR TRUE)) AS r2l,
(TRUE AND (FALSE AND FALSE)) OR TRUE AS r2l_and_precedence;
Insert cell
Insert cell
client
-- get all trips
SELECT * FROM trips;
Insert cell
client
-- find fare_amount per trip_distance for yellow cabs before 2015
-- sort by the result
SELECT
fare_amount,
cab_type,
fare_amount / trip_distance AS fare_per_distance,
pickup_date
FROM trips
WHERE cab_type = 'green' AND pickup_date < '2015-01-01'
LIMIT 50 OFFSET 50;
Insert cell
client
-- what types of payments are recorded in the table
SELECT DISTINCT payment_type_ FROM trips;
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {toc} from "@nebrius/indented-toc"
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