Skip to main content

Races

[dbo.races]

Column nameKeyData typeAllow NULLsDefaultDescription
raceIdPrimary KeyINT
yearFK_Races_Year (dbo.seasons year)INT0Foreign key link to seasons table
roundINT0Round number
circuitIdFK_Races_CircuitID (dbo.circuits circuitId)INT0
nameVARCHAR(255)Race name
dateDATE0000-00-00Race date e.g. "1950-05-13"
timeTIMERace start time e.g."13:00:00"
urlVARCHAR(2048)Race Wikipedia page
fp1_dateDATEFP1 date
fp1_timeTIMEFP1 start time
fp2_dateDATEFP2 date
fp2_timeTIMEFP2 start time
fp3_dateDATEFP3 date
fp3_timeTIMEFP3 start time
quali_dateDATEQualifying date
quali_timeTIMEQualifying start time
sprint_dateDATESprint date
sprint_timeTIMESprint start time

Table Relationships

Races

Where Used

Where is this table referenced and what columns are used? The below table shows that information.

[dbo.races]

Parent_schemaNameParent_tableNameParent_columnNameSchematablecolumnconstraint_name
dboracesraceIddbopitStopsraceIdFK_PitStops_RaceID
dboracesraceIddbolapTimesraceIdFK_LapTimes_RaceID
dboracesraceIddbodriverStandingsraceIdFK_DriverStandings_RaceID
dboracesraceIddboconstructorStandingsraceIdFK_ConstructorStandings_RaceID
dboracesraceIddboconstructorResultsraceIdFK_ConstructorResults_RaceID
dboracesraceIddboqualifyingraceIdFK_Qualifying_RaceID
dboracesraceIddboresultsraceIdFK_Results_RaceID

Example Query

SELECT 
[raceId]
,[year]
,[round]
,c.[circuitId]
,c.name AS [circuit_name]
,r.[name] AS [race_name]
,[date]
,[time]
,r.[url]
,[fp1_date]
,[fp1_time]
,[fp2_date]
,[fp2_time]
,[fp3_date]
,[fp3_time]
,[quali_date]
,[quali_time]
,[sprint_date]
,[sprint_time]
FROM
[dbo].[races] r

INNER JOIN [dbo].[circuits] c
ON r.circuitId = c.circuitId
WHERE
[year] = '2023'

Example Output

raceIdyearroundcircuitIdnamedatetimeurlfp1_datefp1_timefp2_datefp2_timefp3_datefp3_timequali_datequali_timesprint_datesprint_time
1200911Australian Grand Prix2009-03-2906:00:00.0000000http://en.wikipedia.org/wiki/2009_Australian_Grand_Prix1900-01-0100:00:00.00000001900-01-0100:00:00.00000001900-01-0100:00:00.00000001900-01-0100:00:00.00000001900-01-0100:00:00.0000000
2200922Malaysian Grand Prix2009-04-0509:00:00.0000000http://en.wikipedia.org/wiki/2009_Malaysian_Grand_Prix1900-01-0100:00:00.00000001900-01-0100:00:00.00000001900-01-0100:00:00.00000001900-01-0100:00:00.00000001900-01-0100:00:00.0000000