Long Recorded Grand Prix Careers

Medium · Formula 1 · Tables: drivers, results, races

For each driver appearing in results in at least 15 distinct race years, find the first and last recorded year and count distinct seasons. Return integer driver_id, full name (forename, space, surname), integer first_year and last_year, and seasons. Race result appearances are not necessarily race starts. Return columns driver_id, driver, first_year, last_year, seasons, in that order. Order by seasons descending, then driver_id ascending. All source columns have TEXT affinity: cast numeric inputs before numeric comparisons or calculations. Counts and calculated numeric outputs must be numbers, not text.

More SQL practice problems