Skip to content

NYC Taxi — Monthly Year-over-Year

NYC Taxi benchmark · all NYC Taxi queries

Compare monthly patterns across years

Representative SQL

Rendered in the benchmark’s native SQL with default parameters (no dialect translation available).

SELECT
EXTRACT(YEAR FROM pickup_datetime) AS year,
EXTRACT(MONTH FROM pickup_datetime) AS month,
COUNT(*) AS trip_count,
SUM(total_amount) AS total_revenue,
AVG(total_amount) AS avg_fare
FROM trips
WHERE
pickup_datetime >= '2019-01-01' AND pickup_datetime < '2020-12-31'
GROUP BY
EXTRACT(YEAR FROM pickup_datetime),
EXTRACT(MONTH FROM pickup_datetime)
ORDER BY
year,
month

Representative DataFrame

No DataFrame implementation is registered for this query.

Get the exact query for your run

The blocks above are representative. To get the precise statement a specific platform runs at a specific scale, substitute your own values:

from benchbox import NYCTaxi
bench = NYCTaxi(scale_factor=1.0) # your scale factor
queries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQL
print(queries['monthly-year-over-year'])

Source

Query text: benchbox/core/nyctaxi/queries.py