Skip to content

NASCAR

Cup, O'Reilly Auto Parts and Truck Series schedules, results, standings and laps

Connector software
Free and open source
Service credentials
Not needed
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/nascar/index.md to help me query NASCAR with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

Current Cup Series top ten.

Example output Β· captured
Connector release
v0.3.1
Engine
2.0.1
VGI protocol
3.4.0
SELECT position, driver_name, points, points_behind_leader, wins, top_5
FROM nascar.main.current_standings
WHERE series_id = 1
ORDER BY position
LIMIT 10
Result Β· first 5 rows
position driver_name points points_behind_leader wins top_5
1 Kyle Larson 2501 0 3 15
2 Christopher Bell 2452 49 1 16
3 Denny Hamlin 2445 56 4 16
4 Ryan Blaney 2407 94 4 12
5 Tyler Reddick 2397 104 6 15

Quick start

Choose where to run NASCAR, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'nascar' AS nascar (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-nascar'
);

3. Run a query

query.sql
SELECT position, driver_name, points, points_behind_leader, wins, top_5
FROM nascar.main.current_standings
WHERE series_id = 1
ORDER BY position
LIMIT 10
More example queries β†’
Technical details
Verified connector release
v0.3.1
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'nascar' AS nascar (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-nascar'
);

Overview

Read-only NASCAR schedules, results, standings, lap times and pit stops from NASCAR's feeds

Catalog

Everything nascar exposes once attached β€” read straight from the worker's released build.

nascar 1 schema
main 4 tables Β· 16 functions

NASCAR national-series schedules, results, standings and race detail

Schema examples (6)
Examples (6)

Current Cup Series top ten.

SELECT position, driver_name, points, points_behind_leader, wins, top_5
FROM nascar.main.current_standings
WHERE series_id = 1
ORDER BY position
LIMIT 10;
Result Β· first 5 rows
position driver_name points points_behind_leader wins top_5
1 Kyle Larson 2501 0 3 15
2 Christopher Bell 2452 49 1 16
3 Denny Hamlin 2445 56 4 16
4 Ryan Blaney 2407 94 4 12
5 Tyler Reddick 2397 104 6 15

Points leader of each series.

SELECT series_name, driver_name, points
FROM nascar.main.current_standings
WHERE position = 1
ORDER BY series_id;

Top five of each series' latest race with each driver's championship position, season points and wins from the current standings.

SELECT s.series_name, r.finishing_position, r.driver_name,
  s.position AS championship_position, s.points, s.wins
FROM nascar.main.last_race_results r
JOIN nascar.main.current_standings s USING (series_id, driver_id)
WHERE r.finishing_position <= 5
ORDER BY r.series_id, r.finishing_position;

Top ten of the 2026 Cup Series Championship Race with the green- and yellow-flag pit stops each made and their total time on pit road.

SELECT r.finishing_position, r.driver_name, count(*) AS stops,
  sum(p.pit_road_seconds) AS pit_road_seconds
FROM nascar.main.race_results(5601, season := 2026) r
JOIN nascar.main.pit_stops(5601, season := 2026) p USING (driver_id)
WHERE r.finishing_position <= 10 AND p.pit_in_flag_state IN (1, 2)
GROUP BY r.finishing_position, r.driver_name
ORDER BY r.finishing_position;
2 more examples

Where each stage winner of the 2026 Cup Series Championship Race finished, and the laps they led.

SELECT s.stage_number, s.driver_name, s.stage_points, r.finishing_position,
  r.laps_led
FROM nascar.main.stage_results(5601, season := 2026) s
JOIN nascar.main.race_results(5601, season := 2026) r USING (driver_id)
WHERE s.position = 1
ORDER BY s.stage_number;

Drivers named most often in the 2026 Cup Series Championship Race lap-by-lap commentary, with where each finished.

WITH mentions AS (SELECT unnest(driver_ids) AS driver_id FROM nascar.main.lap_notes(5601, season := 2026)) SELECT r.driver_name, count(*) AS mentions, r.finishing_position
FROM mentions
JOIN nascar.main.race_results(5601, season := 2026) r USING (driver_id)
GROUP BY r.driver_name, r.finishing_position
ORDER BY mentions DESC, r.finishing_position
LIMIT 10;
Tables
current_schedule 1 example35 cols

Current-season race schedule and summaries for all three national series

Columns
season INTEGER
Season year.
series_id INTEGER
NASCAR series: 1 Cup, 2 O'Reilly Auto Parts (Xfinity), 3 Truck.
series_name VARCHAR
Full series name.
race_idnot null INTEGER
Stable NASCAR race identifier.
race_name VARCHAR
Official race name, including the sponsor.
race_type_id INTEGER
NASCAR race type: 1 points race, 2 non-points exhibition.
is_points_race BOOLEAN
Whether the race awards championship points.
playoff_round INTEGER
Playoff round number; 0 for regular-season races.
track_id INTEGER
NASCAR track identifier.
track_name VARCHAR
Name of the speedway, road course or street circuit.
race_date TIMESTAMP
Race start as NASCAR publishes it, wall clock without offset: US Eastern (America/New_York) for most races, track-local time for some 2019-2023 races at Pacific and Mountain tracks.
qualifying_date TIMESTAMP
Qualifying time as published, wall clock without offset (same zone caveat as race_date).
scheduled_laps INTEGER
Scheduled race distance in laps.
actual_laps INTEGER
Laps actually run, including overtime; 0 before the race.
scheduled_distance DOUBLE
Scheduled race distance in miles.
actual_distance DOUBLE
Distance actually run in miles.
stage_1_laps INTEGER
Length of stage 1 in laps; 0 when the race has no stages.
stage_2_laps INTEGER
Length of stage 2 in laps.
stage_3_laps INTEGER
Length of the final stage in laps.
cars_in_field INTEGER
Number of starters.
pole_winner_driver_id INTEGER
Driver identifier of the pole winner.
pole_winner_speed DOUBLE
Pole-winning qualifying speed in mph.
winner_driver_id INTEGER
Driver identifier of the race winner; NULL before the race and for 2015-2016 races.
winner_name VARCHAR
Race winner's name, from the driver list or official results.
lead_changes INTEGER
Number of lead changes.
leaders INTEGER
Number of different leaders.
cautions INTEGER
Number of caution periods.
caution_laps INTEGER
Laps run under caution.
average_speed DOUBLE
Winner's average speed in mph.
total_race_time VARCHAR
Race duration as published, H:MM:SS.
margin_of_victory VARCHAR
Margin of victory as published, in seconds.
restrictor_plate BOOLEAN
Whether the race used superspeedway (drafting) rules.
television_broadcaster VARCHAR
Network carrying the race on US television, for example FOX or NBC.
radio_broadcaster VARCHAR
Radio network carrying the race, for example MRN or PRN.
is_completed BOOLEAN
Whether the race has been run.
ConstraintsPRIMARY KEY (race_id)
Example

Cup Series winners so far this season.

SELECT race_date, race_name, track_name, winner_name
FROM nascar.main.current_schedule
WHERE series_id = 1 AND is_completed
ORDER BY race_date;
Link
current_standings 2 examples31 cols

Current-season driver points standings, one row per driver per series

Columns
season INTEGER
Season the standings belong to.
series_idnot null INTEGER
NASCAR series: 1 Cup, 2 O'Reilly Auto Parts (Xfinity), 3 Truck.
series_name VARCHAR
Full series name.
position INTEGER
Championship position (1 = points leader).
driver_idnot null INTEGER
Stable NASCAR driver identifier (joins every table and drivers()).
driver_name VARCHAR
Driver's full name.
first_name VARCHAR
Driver's first name.
last_name VARCHAR
Driver's last name.
car_number VARCHAR
Car number as displayed.
manufacturer VARCHAR
Car manufacturer.
points INTEGER
Championship points total (points).
points_behind_leader INTEGER
Points behind the leader (0 for the leader).
points_earned_last_race INTEGER
Points earned in the most recent race.
previous_position INTEGER
Championship position before the most recent race.
positions_gained INTEGER
Positions gained (positive) or lost since the previous race.
playoff_eligible BOOLEAN
Whether NASCAR flags the driver as playoff-eligible.
playoff_rank INTEGER
Playoff seeding rank; 0 when not applicable.
playoff_points INTEGER
Playoff bonus points.
playoff_race_wins INTEGER
Race wins counted toward the playoffs.
starts INTEGER
Number of races started.
wins INTEGER
Number of race wins.
poles INTEGER
Number of pole positions.
top_5 INTEGER
Number of top-five finishes.
top_10 INTEGER
Number of top-ten finishes.
laps_led INTEGER
Number of laps completed in the lead.
dnf INTEGER
Number of races not finished (DNF).
stage_points INTEGER
Points earned from stage finishes.
stage_1_wins INTEGER
Number of stage 1 wins.
stage_2_wins INTEGER
Number of stage 2 wins.
stage_3_wins INTEGER
Stage 3 wins (races with three stages before the finish).
playoff_stage_wins INTEGER
Stage wins counted toward the playoffs.
ConstraintsPRIMARY KEY (series_id, driver_id)
Examples (2)

Current Cup Series top ten.

SELECT position, driver_name, points, points_behind_leader, wins, top_5
FROM nascar.main.current_standings
WHERE series_id = 1
ORDER BY position
LIMIT 10;
Result Β· first 5 rows
position driver_name points points_behind_leader wins top_5
1 Kyle Larson 2501 0 3 15
2 Christopher Bell 2452 49 1 16
3 Denny Hamlin 2445 56 4 16
4 Ryan Blaney 2407 94 4 12
5 Tyler Reddick 2397 104 6 15

Points leader of each series.

SELECT series_name, driver_name, points
FROM nascar.main.current_standings
WHERE position = 1
ORDER BY series_id;
Link
last_race_results 2 examples35 cols

Official results of each series' most recently completed race

Columns
season INTEGER
Season year.
series_id INTEGER
NASCAR series: 1 Cup, 2 O'Reilly Auto Parts (Xfinity), 3 Truck.
race_idnot null INTEGER
Stable NASCAR race identifier.
race_name VARCHAR
Official race name.
track_name VARCHAR
Name of the speedway, road course or street circuit.
race_date TIMESTAMP
Race start as NASCAR publishes it, wall clock without offset: US Eastern (America/New_York) for most races, track-local time for some 2019-2023 races at Pacific and Mountain tracks.
finishing_position INTEGER
Official finishing position (1 = winner).
starting_position INTEGER
Grid position at the start (1 = pole).
car_number VARCHAR
Car number as displayed, for example 12 or 00.
driver_idnot null INTEGER
Stable NASCAR driver identifier (joins every table and drivers()).
driver_name VARCHAR
Driver's full name.
team_id INTEGER
NASCAR team identifier.
team_name VARCHAR
Race team (organization) fielding the car.
owner_id INTEGER
Car owner identifier.
owner_name VARCHAR
Car owner name.
crew_chief_id INTEGER
Crew chief identifier.
crew_chief_name VARCHAR
Full name of the crew chief for this race.
manufacturer VARCHAR
Car manufacturer, for example Chevrolet, Ford or Toyota.
car_model VARCHAR
Car model, for example Camaro, Mustang or Camry.
sponsor VARCHAR
Primary sponsor as published.
qualifying_position INTEGER
Position in qualifying (1 = fastest).
qualifying_speed DOUBLE
Qualifying speed in mph.
laps_completed INTEGER
Number of laps completed before finishing or retiring.
laps_led INTEGER
Number of laps completed in the lead.
times_led INTEGER
Number of separate times the driver led.
laps_behind INTEGER
Laps behind the winner at the finish.
time_behind_seconds DECIMAL(9,3)
Seconds behind the winner for cars on the lead lap.
finishing_status VARCHAR
Status at the finish, for example Running or Accident.
points_earned INTEGER
Championship points earned in this race, including stages.
playoff_points_earned INTEGER
Playoff bonus points earned in this race.
points_position INTEGER
Driver's championship position after this race.
disqualified BOOLEAN
Whether the entry was disqualified.
hometown_city VARCHAR
Driver's hometown city.
hometown_state VARCHAR
Driver's hometown state or province.
hometown_country VARCHAR
Driver's hometown country.
ConstraintsPRIMARY KEY (race_id, driver_id)
Examples (2)

Top five of the latest Cup Series race.

SELECT race_name, finishing_position, driver_name, team_name, laps_led
FROM nascar.main.last_race_results
WHERE series_id = 1 AND finishing_position <= 5
ORDER BY finishing_position;

Top five of each series' latest race with each driver's championship position, season points and wins from the current standings.

SELECT s.series_name, r.finishing_position, r.driver_name,
  s.position AS championship_position, s.points, s.wins
FROM nascar.main.last_race_results r
JOIN nascar.main.current_standings s USING (series_id, driver_id)
WHERE r.finishing_position <= 5
ORDER BY r.series_id, r.finishing_position;
Link
live_race 1 example23 cols

The NASCAR session currently on track; empty when nothing is running

Columns
race_idnot null INTEGER
Race identifier of the session on track.
series_id INTEGER
NASCAR series of the session.
series_name VARCHAR
Full series name.
run_id INTEGER
Session identifier.
run_name VARCHAR
Session name.
run_type VARCHAR
Session kind: practice, qualifying or race.
track_id INTEGER
Track identifier.
track_name VARCHAR
Name of the speedway, road course or street circuit.
track_length DOUBLE
Track length in miles.
lap_number INTEGER
Current lap.
laps_in_race INTEGER
Scheduled laps in the session.
laps_to_go INTEGER
Laps remaining.
flag_state INTEGER
NASCAR flag code: 1 green, 2 yellow, 3 red, 4 checkered, 8 pre-race, 9 none.
flag VARCHAR
Flag name for flag_state.
elapsed_seconds INTEGER
Elapsed session time in seconds.
cautions INTEGER
Caution periods so far.
caution_laps INTEGER
Laps under caution so far.
lead_changes INTEGER
Lead changes so far.
leaders INTEGER
Different leaders so far.
stage_number INTEGER
Current stage.
stage_end_lap INTEGER
Lap on which the current stage ends.
cars_on_track INTEGER
Number of cars in the live timing feed.
updated_at TIMESTAMP WITH TIME ZONE
Feed timestamp, converted to UTC.
ConstraintsPRIMARY KEY (race_id)
Example

Whether a session is on track, with its lap and flag; returns 0 with NULL session, lap and flag when no session is running.

SELECT count(*) AS sessions_on_track, max(run_name) AS session,
  max(lap_number) AS lap, max(flag) AS flag
FROM nascar.main.live_race;
Link
Table functions
all_current_schedule () 1 example

Current NASCAR season schedule (scan behind current_schedule)

No arguments
Returns columns
season INTEGER
Season year
series_id INTEGER
NASCAR series: 1 Cup, 2 O'Reilly Auto Parts (Xfinity), 3 Truck
series_name VARCHAR
Full series name
race_id INTEGER
Stable NASCAR race identifier
race_name VARCHAR
Official race name, including the sponsor
race_type_id INTEGER
NASCAR race type: 1 points race, 2 non-points exhibition
is_points_race BOOLEAN
Whether the race awards championship points
playoff_round INTEGER
Playoff round number; 0 for regular-season races
track_id INTEGER
NASCAR track identifier
track_name VARCHAR
Name of the speedway, road course or street circuit
race_date TIMESTAMP
Race start as NASCAR publishes it, wall clock without offset: US Eastern (America/New_York) for most races, track-local time for some 2019-2023 races at Pacific and Mountain tracks
qualifying_date TIMESTAMP
Qualifying time as published, wall clock without offset (same zone caveat as race_date)
scheduled_laps INTEGER
Scheduled race distance in laps
actual_laps INTEGER
Laps actually run, including overtime; 0 before the race
scheduled_distance DOUBLE
Scheduled race distance in miles
actual_distance DOUBLE
Distance actually run in miles
stage_1_laps INTEGER
Length of stage 1 in laps; 0 when the race has no stages
stage_2_laps INTEGER
Length of stage 2 in laps
stage_3_laps INTEGER
Length of the final stage in laps
cars_in_field INTEGER
Number of starters
pole_winner_driver_id INTEGER
Driver identifier of the pole winner
pole_winner_speed DOUBLE
Pole-winning qualifying speed in mph
winner_driver_id INTEGER
Driver identifier of the race winner; NULL before the race and for 2015-2016 races
winner_name VARCHAR
Race winner's name, from the driver list or official results
lead_changes INTEGER
Number of lead changes
leaders INTEGER
Number of different leaders
cautions INTEGER
Number of caution periods
caution_laps INTEGER
Laps run under caution
average_speed DOUBLE
Winner's average speed in mph
total_race_time VARCHAR
Race duration as published, H:MM:SS
margin_of_victory VARCHAR
Margin of victory as published, in seconds
restrictor_plate BOOLEAN
Whether the race used superspeedway (drafting) rules
television_broadcaster VARCHAR
Network carrying the race on US television, for example FOX or NBC
radio_broadcaster VARCHAR
Radio network carrying the race, for example MRN or PRN
is_completed BOOLEAN
Whether the race has been run
Example

Races scheduled and already run in each series this season.

SELECT series_name, count(*) AS races,
  count(*) FILTER (WHERE is_completed) AS completed
FROM nascar.main.all_current_schedule()
GROUP BY series_name
ORDER BY series_name;
Link
all_current_standings () 1 example

Current NASCAR driver points standings (scan behind current_standings)

No arguments
Returns columns
season INTEGER
Season the standings belong to
series_id INTEGER
NASCAR series: 1 Cup, 2 O'Reilly Auto Parts (Xfinity), 3 Truck
series_name VARCHAR
Full series name
position INTEGER
Championship position (1 = points leader)
driver_id INTEGER
Stable NASCAR driver identifier (joins every table and drivers())
driver_name VARCHAR
Driver's full name
first_name VARCHAR
Driver's first name
last_name VARCHAR
Driver's last name
car_number VARCHAR
Car number as displayed
manufacturer VARCHAR
Car manufacturer
points INTEGER
Championship points total (points)
points_behind_leader INTEGER
Points behind the leader (0 for the leader)
points_earned_last_race INTEGER
Points earned in the most recent race
previous_position INTEGER
Championship position before the most recent race
positions_gained INTEGER
Positions gained (positive) or lost since the previous race
playoff_eligible BOOLEAN
Whether NASCAR flags the driver as playoff-eligible
playoff_rank INTEGER
Playoff seeding rank; 0 when not applicable
playoff_points INTEGER
Playoff bonus points
playoff_race_wins INTEGER
Race wins counted toward the playoffs
starts INTEGER
Number of races started
wins INTEGER
Number of race wins
poles INTEGER
Number of pole positions
top_5 INTEGER
Number of top-five finishes
top_10 INTEGER
Number of top-ten finishes
laps_led INTEGER
Number of laps completed in the lead
dnf INTEGER
Number of races not finished (DNF)
stage_points INTEGER
Points earned from stage finishes
stage_1_wins INTEGER
Number of stage 1 wins
stage_2_wins INTEGER
Number of stage 2 wins
stage_3_wins INTEGER
Stage 3 wins (races with three stages before the finish)
playoff_stage_wins INTEGER
Stage wins counted toward the playoffs
Example

Read the table's backing scan directly: the Cup Series top ten.

SELECT position, driver_name, points, wins
FROM nascar.main.all_current_standings()
WHERE series_id = 1
ORDER BY position
LIMIT 10;
Link
all_last_race_results () 1 example

Results of each series' most recent race (scan behind last_race_results)

No arguments
Returns columns
season INTEGER
Season year
series_id INTEGER
NASCAR series: 1 Cup, 2 O'Reilly Auto Parts (Xfinity), 3 Truck
race_id INTEGER
Stable NASCAR race identifier
race_name VARCHAR
Official race name
track_name VARCHAR
Name of the speedway, road course or street circuit
race_date TIMESTAMP
Race start as NASCAR publishes it, wall clock without offset: US Eastern (America/New_York) for most races, track-local time for some 2019-2023 races at Pacific and Mountain tracks
finishing_position INTEGER
Official finishing position (1 = winner)
starting_position INTEGER
Grid position at the start (1 = pole)
car_number VARCHAR
Car number as displayed, for example 12 or 00
driver_id INTEGER
Stable NASCAR driver identifier (joins every table and drivers())
driver_name VARCHAR
Driver's full name
team_id INTEGER
NASCAR team identifier
team_name VARCHAR
Race team (organization) fielding the car
owner_id INTEGER
Car owner identifier
owner_name VARCHAR
Car owner name
crew_chief_id INTEGER
Crew chief identifier
crew_chief_name VARCHAR
Full name of the crew chief for this race
manufacturer VARCHAR
Car manufacturer, for example Chevrolet, Ford or Toyota
car_model VARCHAR
Car model, for example Camaro, Mustang or Camry
sponsor VARCHAR
Primary sponsor as published
qualifying_position INTEGER
Position in qualifying (1 = fastest)
qualifying_speed DOUBLE
Qualifying speed in mph
laps_completed INTEGER
Number of laps completed before finishing or retiring
laps_led INTEGER
Number of laps completed in the lead
times_led INTEGER
Number of separate times the driver led
laps_behind INTEGER
Laps behind the winner at the finish
time_behind_seconds DECIMAL(9,3)
Seconds behind the winner for cars on the lead lap
finishing_status VARCHAR
Status at the finish, for example Running or Accident
points_earned INTEGER
Championship points earned in this race, including stages
playoff_points_earned INTEGER
Playoff bonus points earned in this race
points_position INTEGER
Driver's championship position after this race
disqualified BOOLEAN
Whether the entry was disqualified
hometown_city VARCHAR
Driver's hometown city
hometown_state VARCHAR
Driver's hometown state or province
hometown_country VARCHAR
Driver's hometown country
Example

Read the table's backing scan directly: each series' latest winner.

SELECT series_id, race_name, driver_name
FROM nascar.main.all_last_race_results()
WHERE finishing_position = 1
ORDER BY series_id;
Link
all_live_race () 1 example

Status of the NASCAR session currently on track (scan behind live_race)

No arguments
Returns columns
race_id INTEGER
Race identifier of the session on track
series_id INTEGER
NASCAR series of the session
series_name VARCHAR
Full series name
run_id INTEGER
Session identifier
run_name VARCHAR
Session name
run_type VARCHAR
Session kind: practice, qualifying or race
track_id INTEGER
Track identifier
track_name VARCHAR
Name of the speedway, road course or street circuit
track_length DOUBLE
Track length in miles
lap_number INTEGER
Current lap
laps_in_race INTEGER
Scheduled laps in the session
laps_to_go INTEGER
Laps remaining
flag_state INTEGER
NASCAR flag code: 1 green, 2 yellow, 3 red, 4 checkered, 8 pre-race, 9 none
flag VARCHAR
Flag name for flag_state
elapsed_seconds INTEGER
Elapsed session time in seconds
cautions INTEGER
Caution periods so far
caution_laps INTEGER
Laps under caution so far
lead_changes INTEGER
Lead changes so far
leaders INTEGER
Different leaders so far
stage_number INTEGER
Current stage
stage_end_lap INTEGER
Lap on which the current stage ends
cars_on_track INTEGER
Number of cars in the live timing feed
updated_at TIMESTAMP WITH TIME ZONE
Feed timestamp, converted to UTC
Example

Read the table's backing scan directly: is anything on track right now? Returns 0 with NULL lap and flag when no session is running.

SELECT count(*) AS sessions_on_track, max(lap_number) AS lap,
  max(flag) AS flag
FROM nascar.main.all_live_race();
Link
drivers (series := VARCHAR) 1 example

NASCAR driver profiles: names, birth dates, hometowns, teams and rookie year

Named arguments
series := VARCHAR
Restrict to driver profiles for one series; NULL returns every profile. Β· default null
Returns columns
driver_id INTEGER
Stable NASCAR driver identifier (joins every table and drivers())
series VARCHAR
NASCAR's series slug for the profile, for example nascar-cup-series
full_name VARCHAR
Driver's full name
first_name VARCHAR
Driver's first name
last_name VARCHAR
Driver's last name
birth_date DATE
Date of birth, when NASCAR publishes it
hometown_city VARCHAR
Hometown city
hometown_state VARCHAR
Hometown state or province
hometown_country VARCHAR
Hometown country
team VARCHAR
Current team as published on the driver profile
crew_chief VARCHAR
Current crew chief as published on the driver profile
car_badge VARCHAR
Car-number badge on the profile (some placeholders repeat the ID)
rookie_year INTEGER
Rookie year as published on the profile (NASCAR repeats one value in all three series fields)
part_time BOOLEAN
Whether NASCAR marks the driver as part-time
profile_published BOOLEAN
Whether the nascar.com driver profile is published
twitter_handle VARCHAR
Social handle as published
profile_url VARCHAR
Link to the driver's nascar.com page
image_url VARCHAR
Link to NASCAR's driver image (not copied or rehosted)
Example

Published Cup Series driver profiles with hometowns.

SELECT full_name, team, hometown_city, hometown_state, birth_date
FROM nascar.main.drivers(series := 'cup')
WHERE profile_published
ORDER BY last_name;
Link
lap_notes (race_id INTEGER, season := INTEGER) 2 examples

NASCAR's lap-by-lap race commentary notes for one race

Positional arguments
race_id INTEGER
NASCAR race identifier (see schedule()).
Named arguments
season := INTEGER
Season of the race. Optional: NULL searches the seasons for race_id (slower). Β· default null
Returns columns
season INTEGER
Season year
series_id INTEGER
NASCAR series: 1 Cup, 2 O'Reilly Auto Parts (Xfinity), 3 Truck
race_id INTEGER
Stable NASCAR race identifier
lap INTEGER
Lap the note refers to; lap 0 covers pre-race and qualifying
note_id BIGINT
NASCAR note identifier
flag_state INTEGER
NASCAR flag code: 1 green, 2 yellow, 3 red, 4 checkered, 8 pre-race, 9 none
note VARCHAR
NASCAR's lap-by-lap race commentary
driver_ids INTEGER[]
Distinct driver identifiers mentioned in the note
Examples (2)

Commentary for the final ten laps of the 2026 Cup Series Championship Race.

SELECT lap, note
FROM nascar.main.lap_notes(5601, season := 2026)
WHERE lap >= 258
ORDER BY lap, note_id;

Drivers named most often in the 2026 Cup Series Championship Race lap-by-lap commentary, with where each finished.

WITH mentions AS (SELECT unnest(driver_ids) AS driver_id FROM nascar.main.lap_notes(5601, season := 2026)) SELECT r.driver_name, count(*) AS mentions, r.finishing_position
FROM mentions
JOIN nascar.main.race_results(5601, season := 2026) r USING (driver_id)
GROUP BY r.driver_name, r.finishing_position
ORDER BY mentions DESC, r.finishing_position
LIMIT 10;
Link
lap_times (race_id INTEGER, season := INTEGER) 1 example

Lap-by-lap times, speeds and running positions for one NASCAR race (2020 onwards)

Positional arguments
race_id INTEGER
NASCAR race identifier (see schedule()).
Named arguments
season := INTEGER
Season of the race. Optional: NULL searches the seasons for race_id (slower). Β· default null
Returns columns
season INTEGER
Season year
series_id INTEGER
NASCAR series: 1 Cup, 2 O'Reilly Auto Parts (Xfinity), 3 Truck
race_id INTEGER
Stable NASCAR race identifier
driver_id INTEGER
Stable NASCAR driver identifier (joins every table and drivers())
driver_name VARCHAR
Driver's name with NASCAR's scoring markers removed
car_number VARCHAR
Car number as displayed
manufacturer VARCHAR
Car manufacturer
lap INTEGER
Lap number; lap 0 is the starting grid
lap_time_seconds DECIMAL(9,3)
Lap time in seconds; NULL on lap 0
lap_speed DECIMAL(8,3)
Lap speed in mph; NULL on lap 0
running_position INTEGER
Running position at the end of the lap
flag_state INTEGER
Flag code at the end of the lap: 1 green, 2 yellow, 3 red, 4 checkered, 8 pre-race, 9 none
Example

Each driver's fastest lap in the 2026 Cup Series Championship Race.

SELECT driver_name, min(lap_time_seconds) AS best_lap,
  max(lap_speed) AS best_speed
FROM nascar.main.lap_times(5601, season := 2026)
GROUP BY driver_name
ORDER BY best_lap
LIMIT 10;
Link
loop_stats (race_id INTEGER, season := INTEGER) 1 example

NASCAR loop-data statistics (driver rating, passes, average position) for one race

Positional arguments
race_id INTEGER
NASCAR race identifier (see schedule()).
Named arguments
season := INTEGER
Season of the race. Optional: NULL searches the seasons for race_id (slower). Β· default null
Returns columns
season INTEGER
Season year
series_id INTEGER
NASCAR series: 1 Cup, 2 O'Reilly Auto Parts (Xfinity), 3 Truck
race_id INTEGER
Stable NASCAR race identifier
driver_id INTEGER
Stable NASCAR driver identifier (joins every table and drivers())
driver_name VARCHAR
Driver's name, matched from the race results
car_number VARCHAR
Car number, matched from the race results
start_position INTEGER
Grid position at the start (1 = pole)
mid_race_position INTEGER
Position at the race's halfway point
finish_position INTEGER
Finishing position
closing_position INTEGER
Position at the start of the final 10% of the race
closing_laps_diff INTEGER
Positions gained over the closing laps
best_position INTEGER
Best running position at any lap
worst_position INTEGER
Worst running position at any lap
average_position DOUBLE
Average running position across all laps
green_flag_passes INTEGER
Green-flag passes made
green_flag_times_passed INTEGER
Times passed by other cars under green
passing_differential INTEGER
Green-flag passes made minus times passed
quality_passes INTEGER
Green-flag passes of cars running in the top 15
fastest_laps INTEGER
Laps on which the driver was fastest in the field
top_15_laps INTEGER
Laps run inside the top 15
laps_led INTEGER
Number of laps completed in the lead
laps INTEGER
Number of laps completed before finishing or retiring
driver_rating DOUBLE
NASCAR driver rating, a 0-150 loop-data composite
Example

Highest driver ratings in the 2026 Cup Series Championship Race.

SELECT driver_name, driver_rating, green_flag_passes, quality_passes,
  average_position
FROM nascar.main.loop_stats(5601, season := 2026)
ORDER BY driver_rating DESC
LIMIT 10;
Link
pit_stops (race_id INTEGER, season := INTEGER) 2 examples

Timed pit-road visits with tire service for one NASCAR race

Positional arguments
race_id INTEGER
NASCAR race identifier (see schedule()).
Named arguments
season := INTEGER
Season of the race. Optional: NULL searches the seasons for race_id (slower). Β· default null
Returns columns
season INTEGER
Season year
series_id INTEGER
NASCAR series: 1 Cup, 2 O'Reilly Auto Parts (Xfinity), 3 Truck
race_id INTEGER
Stable NASCAR race identifier
stop_number INTEGER
Pit-road visit sequence number for this car
car_number VARCHAR
Car number as displayed
driver_id INTEGER
Driver identifier, matched from the race results by car number
driver_name VARCHAR
Driver's name
manufacturer VARCHAR
Car manufacturer
lap INTEGER
The car's lap count when it entered pit road
leader_lap INTEGER
The leader's lap when the car entered pit road
pit_in_flag_state INTEGER
Flag code at pit entry: 1 green, 2 yellow, 3 red, 8 pre-race
pit_out_flag_state INTEGER
Flag code at pit exit
pit_in_race_time DOUBLE
Elapsed race time at pit entry, in seconds
pit_out_race_time DOUBLE
Elapsed race time at pit exit, in seconds
pit_road_seconds DECIMAL(9,3)
Time on pit road, entry to exit, in seconds; NULL when untimed
stop_seconds DECIMAL(9,3)
Time stationary in the pit box, in seconds; NULL when untimed
in_travel_seconds DECIMAL(9,3)
Pit entry to the pit box, in seconds; NULL when untimed
out_travel_seconds DECIMAL(9,3)
Pit box to pit exit, in seconds; NULL when untimed
stop_type VARCHAR
Service type, for example FOUR_WHEEL_CHANGE or OTHER
tires_changed INTEGER
Number of tires changed, 0 to 4
left_front_changed BOOLEAN
Whether the left-front tire was changed
left_rear_changed BOOLEAN
Whether the left-rear tire was changed
right_front_changed BOOLEAN
Whether the right-front tire was changed
right_rear_changed BOOLEAN
Whether the right-rear tire was changed
position_in INTEGER
Running position at pit entry
position_out INTEGER
Running position at pit exit
positions_gained INTEGER
Positions gained (positive) or lost (negative) on pit road
Examples (2)

Fastest four-tire green-flag stops in the 2026 Cup Series Championship Race.

SELECT driver_name, lap, stop_seconds, pit_road_seconds
FROM nascar.main.pit_stops(5601, season := 2026)
WHERE stop_type = 'FOUR_WHEEL_CHANGE' AND pit_in_flag_state = 1
ORDER BY stop_seconds
LIMIT 10;

Top ten of the 2026 Cup Series Championship Race with the green- and yellow-flag pit stops each made and their total time on pit road.

SELECT r.finishing_position, r.driver_name, count(*) AS stops,
  sum(p.pit_road_seconds) AS pit_road_seconds
FROM nascar.main.race_results(5601, season := 2026) r
JOIN nascar.main.pit_stops(5601, season := 2026) p USING (driver_id)
WHERE r.finishing_position <= 10 AND p.pit_in_flag_state IN (1, 2)
GROUP BY r.finishing_position, r.driver_name
ORDER BY r.finishing_position;
Link
race_cautions (race_id INTEGER, season := INTEGER) 1 example

Caution periods (yellow flags) of one NASCAR race

Positional arguments
race_id INTEGER
NASCAR race identifier (see schedule()).
Named arguments
season := INTEGER
Season of the race. Optional: NULL searches the seasons for race_id (slower). Β· default null
Returns columns
season INTEGER
Season year
series_id INTEGER
NASCAR series: 1 Cup, 2 O'Reilly Auto Parts (Xfinity), 3 Truck
race_id INTEGER
Stable NASCAR race identifier
caution_number INTEGER
Caution sequence number within the race
start_lap INTEGER
First lap run under this caution
end_lap INTEGER
Last lap run under this caution
laps INTEGER
Laps under this caution (inclusive of both ends)
reason VARCHAR
Caution category, for example Competition, Accident or Debris
comment VARCHAR
NASCAR's description of the caution
free_pass_car_number VARCHAR
Car number awarded the free pass (lucky dog), if any
flag_state INTEGER
NASCAR flag code: 1 green, 2 yellow, 3 red, 4 checkered, 8 pre-race, 9 none
Example

Cautions in the 2026 Cup Series Championship Race.

SELECT caution_number, start_lap, end_lap, laps, reason, comment
FROM nascar.main.race_cautions(5601, season := 2026)
ORDER BY caution_number;
Link
race_leaders (race_id INTEGER, season := INTEGER) 1 example

Lap-by-lap lead stints of one NASCAR race

Positional arguments
race_id INTEGER
NASCAR race identifier (see schedule()).
Named arguments
season := INTEGER
Season of the race. Optional: NULL searches the seasons for race_id (slower). Β· default null
Returns columns
season INTEGER
Season year
series_id INTEGER
NASCAR series: 1 Cup, 2 O'Reilly Auto Parts (Xfinity), 3 Truck
race_id INTEGER
Stable NASCAR race identifier
stint_number INTEGER
Lead stint sequence number within the race
start_lap INTEGER
First lap led in this stint
end_lap INTEGER
Last lap led in this stint
laps_led INTEGER
Laps led in this stint (inclusive of both ends)
car_number VARCHAR
Car number of the leader
driver_id INTEGER
Leader's driver identifier, matched from the race results
driver_name VARCHAR
Leader's name, matched from the race results
Example

Laps led by driver in the 2026 Cup Series Championship Race.

SELECT driver_name, sum(laps_led) AS laps_led, count(*) AS stints
FROM nascar.main.race_leaders(5601, season := 2026)
GROUP BY driver_name
ORDER BY laps_led DESC;
Link
race_results (race_id INTEGER, season := INTEGER) 1 example

Official finishing order of one NASCAR race

Positional arguments
race_id INTEGER
NASCAR race identifier (see schedule()).
Named arguments
season := INTEGER
Season of the race. Optional: NULL searches the seasons for race_id (slower). Β· default null
Returns columns
season INTEGER
Season year
series_id INTEGER
NASCAR series: 1 Cup, 2 O'Reilly Auto Parts (Xfinity), 3 Truck
race_id INTEGER
Stable NASCAR race identifier
race_name VARCHAR
Official race name
track_name VARCHAR
Name of the speedway, road course or street circuit
race_date TIMESTAMP
Race start as NASCAR publishes it, wall clock without offset: US Eastern (America/New_York) for most races, track-local time for some 2019-2023 races at Pacific and Mountain tracks
finishing_position INTEGER
Official finishing position (1 = winner)
starting_position INTEGER
Grid position at the start (1 = pole)
car_number VARCHAR
Car number as displayed, for example 12 or 00
driver_id INTEGER
Stable NASCAR driver identifier (joins every table and drivers())
driver_name VARCHAR
Driver's full name
team_id INTEGER
NASCAR team identifier
team_name VARCHAR
Race team (organization) fielding the car
owner_id INTEGER
Car owner identifier
owner_name VARCHAR
Car owner name
crew_chief_id INTEGER
Crew chief identifier
crew_chief_name VARCHAR
Full name of the crew chief for this race
manufacturer VARCHAR
Car manufacturer, for example Chevrolet, Ford or Toyota
car_model VARCHAR
Car model, for example Camaro, Mustang or Camry
sponsor VARCHAR
Primary sponsor as published
qualifying_position INTEGER
Position in qualifying (1 = fastest)
qualifying_speed DOUBLE
Qualifying speed in mph
laps_completed INTEGER
Number of laps completed before finishing or retiring
laps_led INTEGER
Number of laps completed in the lead
times_led INTEGER
Number of separate times the driver led
laps_behind INTEGER
Laps behind the winner at the finish
time_behind_seconds DECIMAL(9,3)
Seconds behind the winner for cars on the lead lap
finishing_status VARCHAR
Status at the finish, for example Running or Accident
points_earned INTEGER
Championship points earned in this race, including stages
playoff_points_earned INTEGER
Playoff bonus points earned in this race
points_position INTEGER
Driver's championship position after this race
disqualified BOOLEAN
Whether the entry was disqualified
hometown_city VARCHAR
Driver's hometown city
hometown_state VARCHAR
Driver's hometown state or province
hometown_country VARCHAR
Driver's hometown country
Example

Finishing order of the 2026 Cup Series Championship Race.

SELECT finishing_position, car_number, driver_name, team_name, laps_led,
  finishing_status
FROM nascar.main.race_results(5601, season := 2026)
ORDER BY finishing_position;
Link
schedule (season := INTEGER, series := VARCHAR) 2 examples

NASCAR race schedule and race summaries by season and series

Named arguments
season := INTEGER
Season year (2015 onwards). NULL selects the current season. Β· default null
series := VARCHAR
Series: cup (NASCAR Cup Series), oreilly or xfinity (O'Reilly Auto Parts Series, formerly Xfinity), or truck (Craftsman Truck Series). NULL returns all three national series. Β· default null
Returns columns
season INTEGER
Season year
series_id INTEGER
NASCAR series: 1 Cup, 2 O'Reilly Auto Parts (Xfinity), 3 Truck
series_name VARCHAR
Full series name
race_id INTEGER
Stable NASCAR race identifier
race_name VARCHAR
Official race name, including the sponsor
race_type_id INTEGER
NASCAR race type: 1 points race, 2 non-points exhibition
is_points_race BOOLEAN
Whether the race awards championship points
playoff_round INTEGER
Playoff round number; 0 for regular-season races
track_id INTEGER
NASCAR track identifier
track_name VARCHAR
Name of the speedway, road course or street circuit
race_date TIMESTAMP
Race start as NASCAR publishes it, wall clock without offset: US Eastern (America/New_York) for most races, track-local time for some 2019-2023 races at Pacific and Mountain tracks
qualifying_date TIMESTAMP
Qualifying time as published, wall clock without offset (same zone caveat as race_date)
scheduled_laps INTEGER
Scheduled race distance in laps
actual_laps INTEGER
Laps actually run, including overtime; 0 before the race
scheduled_distance DOUBLE
Scheduled race distance in miles
actual_distance DOUBLE
Distance actually run in miles
stage_1_laps INTEGER
Length of stage 1 in laps; 0 when the race has no stages
stage_2_laps INTEGER
Length of stage 2 in laps
stage_3_laps INTEGER
Length of the final stage in laps
cars_in_field INTEGER
Number of starters
pole_winner_driver_id INTEGER
Driver identifier of the pole winner
pole_winner_speed DOUBLE
Pole-winning qualifying speed in mph
winner_driver_id INTEGER
Driver identifier of the race winner; NULL before the race and for 2015-2016 races
winner_name VARCHAR
Race winner's name, from the driver list or official results
lead_changes INTEGER
Number of lead changes
leaders INTEGER
Number of different leaders
cautions INTEGER
Number of caution periods
caution_laps INTEGER
Laps run under caution
average_speed DOUBLE
Winner's average speed in mph
total_race_time VARCHAR
Race duration as published, H:MM:SS
margin_of_victory VARCHAR
Margin of victory as published, in seconds
restrictor_plate BOOLEAN
Whether the race used superspeedway (drafting) rules
television_broadcaster VARCHAR
Network carrying the race on US television, for example FOX or NBC
radio_broadcaster VARCHAR
Radio network carrying the race, for example MRN or PRN
is_completed BOOLEAN
Whether the race has been run
Examples (2)

The 2025 Cup Series points races and their winners.

SELECT race_date, race_name, track_name, winner_name
FROM nascar.main.schedule(season := 2025, series := 'cup')
WHERE is_points_race
ORDER BY race_date;

Tracks visited by every national series in 2024.

SELECT track_name, count(DISTINCT series_id) AS series
FROM nascar.main.schedule(season := 2024)
GROUP BY track_name
HAVING series = 3;
Link
season_results (season := INTEGER, series := VARCHAR) 2 examples

Official results of every completed race in one NASCAR series season

Named arguments
season := INTEGER
Season year (2015 onwards). NULL selects the current season. Β· default null
series := VARCHAR
Series: cup (NASCAR Cup Series), oreilly or xfinity (O'Reilly Auto Parts Series, formerly Xfinity), or truck (Craftsman Truck Series). Β· default "cup"
Returns columns
season INTEGER
Season year
series_id INTEGER
NASCAR series: 1 Cup, 2 O'Reilly Auto Parts (Xfinity), 3 Truck
race_id INTEGER
Stable NASCAR race identifier
race_name VARCHAR
Official race name
track_name VARCHAR
Name of the speedway, road course or street circuit
race_date TIMESTAMP
Race start as NASCAR publishes it, wall clock without offset: US Eastern (America/New_York) for most races, track-local time for some 2019-2023 races at Pacific and Mountain tracks
finishing_position INTEGER
Official finishing position (1 = winner)
starting_position INTEGER
Grid position at the start (1 = pole)
car_number VARCHAR
Car number as displayed, for example 12 or 00
driver_id INTEGER
Stable NASCAR driver identifier (joins every table and drivers())
driver_name VARCHAR
Driver's full name
team_id INTEGER
NASCAR team identifier
team_name VARCHAR
Race team (organization) fielding the car
owner_id INTEGER
Car owner identifier
owner_name VARCHAR
Car owner name
crew_chief_id INTEGER
Crew chief identifier
crew_chief_name VARCHAR
Full name of the crew chief for this race
manufacturer VARCHAR
Car manufacturer, for example Chevrolet, Ford or Toyota
car_model VARCHAR
Car model, for example Camaro, Mustang or Camry
sponsor VARCHAR
Primary sponsor as published
qualifying_position INTEGER
Position in qualifying (1 = fastest)
qualifying_speed DOUBLE
Qualifying speed in mph
laps_completed INTEGER
Number of laps completed before finishing or retiring
laps_led INTEGER
Number of laps completed in the lead
times_led INTEGER
Number of separate times the driver led
laps_behind INTEGER
Laps behind the winner at the finish
time_behind_seconds DECIMAL(9,3)
Seconds behind the winner for cars on the lead lap
finishing_status VARCHAR
Status at the finish, for example Running or Accident
points_earned INTEGER
Championship points earned in this race, including stages
playoff_points_earned INTEGER
Playoff bonus points earned in this race
points_position INTEGER
Driver's championship position after this race
disqualified BOOLEAN
Whether the entry was disqualified
hometown_city VARCHAR
Driver's hometown city
hometown_state VARCHAR
Driver's hometown state or province
hometown_country VARCHAR
Driver's hometown country
Examples (2)

2025 Cup Series wins and top-fives by driver, points races only.

SELECT r.driver_name,
  count(*) FILTER (WHERE r.finishing_position = 1) AS wins,
  count(*) FILTER (WHERE r.finishing_position <= 5) AS top_5
FROM nascar.main.season_results(season := 2025) r
JOIN nascar.main.schedule(season := 2025, series := 'cup') USING (race_id)
WHERE is_points_race
GROUP BY r.driver_name
ORDER BY wins DESC, top_5 DESC
LIMIT 10;

Laps led by team in the 2025 Truck Series.

SELECT team_name, sum(laps_led) AS laps_led
FROM nascar.main.season_results(season := 2025, series := 'truck')
GROUP BY team_name
ORDER BY laps_led DESC;
Link
session_results (race_id INTEGER, season := INTEGER) 1 example

Practice and qualifying results for one NASCAR race weekend

Positional arguments
race_id INTEGER
NASCAR race identifier (see schedule()).
Named arguments
season := INTEGER
Season of the race. Optional: NULL searches the seasons for race_id (slower). Β· default null
Returns columns
season INTEGER
Season year
series_id INTEGER
NASCAR series: 1 Cup, 2 O'Reilly Auto Parts (Xfinity), 3 Truck
race_id INTEGER
Stable NASCAR race identifier
run_id INTEGER
NASCAR session identifier
run_name VARCHAR
Session name, for example Practice or Busch Pole Qualifying
run_type VARCHAR
Session kind: practice, qualifying or race
run_date_utc TIMESTAMP WITH TIME ZONE
Session start time in UTC
position INTEGER
Classified position in the session
car_number VARCHAR
Car number as displayed
driver_id INTEGER
Stable NASCAR driver identifier (joins every table and drivers())
driver_name VARCHAR
Driver's full name
manufacturer VARCHAR
Car manufacturer
best_lap_time_seconds DECIMAL(9,3)
Best lap time in seconds
best_lap_speed DECIMAL(8,3)
Best lap speed in mph
best_lap_number INTEGER
Lap on which the best time was set
laps_completed INTEGER
Laps completed in the session
delta_to_leader_seconds DECIMAL(9,3)
Gap to the fastest car in seconds (negative = slower)
disqualified BOOLEAN
Whether the time was disallowed
Example

Qualifying order for the 2026 Cup Series Championship Race.

SELECT position, driver_name, best_lap_time_seconds, best_lap_speed
FROM nascar.main.session_results(5601, season := 2026)
WHERE run_type = 'qualifying'
ORDER BY position;
Link
stage_results (race_id INTEGER, season := INTEGER) 2 examples

Top-ten stage finishes and stage points for one NASCAR race

Positional arguments
race_id INTEGER
NASCAR race identifier (see schedule()).
Named arguments
season := INTEGER
Season of the race. Optional: NULL searches the seasons for race_id (slower). Β· default null
Returns columns
season INTEGER
Season year
series_id INTEGER
NASCAR series: 1 Cup, 2 O'Reilly Auto Parts (Xfinity), 3 Truck
race_id INTEGER
Stable NASCAR race identifier
stage_number INTEGER
Stage number, 1 or 2 (the final stage is the race result)
position INTEGER
Position at the end of the stage
driver_id INTEGER
Stable NASCAR driver identifier (joins every table and drivers())
driver_name VARCHAR
Driver's full name
car_number VARCHAR
Car number as displayed
stage_points INTEGER
Championship points awarded for the stage finish
Examples (2)

Stage winners of the 2026 Cup Series Championship Race.

SELECT stage_number, driver_name, stage_points
FROM nascar.main.stage_results(5601, season := 2026)
WHERE position = 1
ORDER BY stage_number;

Where each stage winner of the 2026 Cup Series Championship Race finished, and the laps they led.

SELECT s.stage_number, s.driver_name, s.stage_points, r.finishing_position,
  r.laps_led
FROM nascar.main.stage_results(5601, season := 2026) s
JOIN nascar.main.race_results(5601, season := 2026) r USING (driver_id)
WHERE s.position = 1
ORDER BY s.stage_number;
Link

Try these queries

current_schedule_is_populated β€” The current season's schedule covers all three national series.

SELECT count(DISTINCT series_id) = 3 AS populated
FROM nascar.main.current_schedule;

Uses current_schedule

current_standings_have_drivers β€” Every current standings row has a driver and a non-negative points total.

SELECT count(*) > 0 AND bool_and(points >= 0) AND count(driver_id) = count(*) AS valid
FROM nascar.main.current_standings;

Uses current_standings

championship_race_2026_winner β€” Ryan Blaney won the 2026 Cup Series Championship Race (race 5601).

SELECT driver_name
FROM nascar.main.race_results(5601, season := 2026)
WHERE finishing_position = 1;

Uses race_results

lead_stints_match_laps_led β€” Lead stints in race 5601 add up to the 267 laps run.

SELECT sum(laps_led)::INTEGER AS laps
FROM nascar.main.race_leaders(5601, season := 2026);

Uses race_leaders

Top five of each series' latest race with each driver's championship position, season points and wins from the current standings.

SELECT s.series_name, r.finishing_position, r.driver_name,
  s.position AS championship_position, s.points, s.wins
FROM nascar.main.last_race_results r
JOIN nascar.main.current_standings s USING (series_id, driver_id)
WHERE r.finishing_position <= 5
ORDER BY r.series_id, r.finishing_position

Uses last_race_resultscurrent_standings

Where each stage winner of the 2026 Cup Series Championship Race finished, and the laps they led.

SELECT s.stage_number, s.driver_name, s.stage_points, r.finishing_position,
  r.laps_led
FROM nascar.main.stage_results(5601, season := 2026) s
JOIN nascar.main.race_results(5601, season := 2026) r USING (driver_id)
WHERE s.position = 1
ORDER BY s.stage_number

Uses stage_resultsrace_results

24 more examples in the Catalog, each listed under the table or function it uses.

Questions it can answer

Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.

  • Who currently leads the points standings in each of NASCAR's three national series?
  • Who won the latest NASCAR Cup race, and how many Cup races are on this year's schedule?
  • Is any NASCAR session on track right now? If so, what lap and flag is it on?
  • Show the top five of the 2026 Cup Series Championship Race (race 5601) with birth dates.
  • Using the lead stints, who led the most laps in 2026 NASCAR race 5601, and how many?
  • List each driver's number of 2025 NASCAR Cup Series points-race wins, most first.

NASCAR is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.