Skip to content
Docs

SQL console

Query every table from your browser at transitlab.nyc/sql. Nothing to install.

The SQL console runs DuckDB inside your browser tab, with the transitlab database already attached. Type a query, run it, and see the result as a table.

It is the quickest way to look around: check a table’s columns, try a filter, or copy a result into a spreadsheet.

-- Every table and its columns
SHOW ALL TABLES;
-- The slowest bus routes in our latest week of data
SELECT route_id, round(sum(meters) / sum(seconds) * 2.23694, 2) AS mph
FROM transitlab.bus_route_speeds
WHERE service_date::DATE >= (SELECT max(service_date)::DATE - 7 FROM transitlab.bus_route_speeds)
GROUP BY route_id
HAVING sum(trips) >= 50
ORDER BY mph
LIMIT 15;

Your browser does the work, so it has your browser’s memory. Queries over small tables and single months of trips run well. For years of trips, use DuckDB on your own machine; the SQL is the same.