NYC Taxi — Revenue by Payment Type
NYC Taxi benchmark · all NYC Taxi queries
Revenue breakdown by payment method
Representative SQL
Rendered for DataFusion with default parameters.
SELECT payment_type, COUNT(*) AS trip_count, SUM(total_amount) AS total_revenue, SUM(tip_amount) AS total_tips, AVG(CAST(tip_amount AS DOUBLE PRECISION) / NULLIF(fare_amount, 0)) * 100 AS avg_tip_percentageFROM tripsWHERE pickup_datetime >= '2019-06-27' AND pickup_datetime < '2019-07-27' AND fare_amount > 0GROUP BY payment_typeORDER BY total_revenue DESC NULLS LASTRepresentative 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 factorqueries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQLprint(queries['revenue-by-payment-type'])Source
Query text: benchbox/core/nyctaxi/queries.py