turbot/formula1

Query: top_10_formula1_race_driver_standings

Usage

powerpipe query formula1.query.top_10_formula1_race_driver_standings

SQL

select
drivers.forename || ' ' || drivers.surname as "Driver",
driver_standings.points as "Points",
driver_standings.position as "Position",
driver_standings.wins as "Wins",
avg(laptimes.milliseconds) as "Average Lap Time",
min(laptimes.milliseconds) as "Best Lap Time",
max(laptimes.milliseconds) as "Worst Lap Time"
from
driver_standings
join drivers on driver_standings.driverId = drivers.driverId
join laptimes on driver_standings.driverId = laptimes.driverId
where
driver_standings.raceId = $1
group by
drivers.forename || ' ' || drivers.surname,
driver_standings.points,
driver_standings.position,
driver_standings.wins
order by
driver_standings.position, "Average Lap Time"
limit 10;

Dashboards

The query is used in the dashboards: