Skip to main content

Drivers

[dbo.drivers]

Column nameKeyData typeAllow NULLsDefaultDescription
driverIdPrimary KeyINT
driverRefVARCHAR(255)Unique driver identifier
numberINTPermanent driver number
codeVARCHAR(3)Driver code e.g. "ALO"
forenameVARCHAR(255)Driver forename
surnameVARCHAR(255)Driver surname
dobDATEDriver date of birth
urlVARCHAR(2048)Driver Wikipedia page
nationalityIDFK_Drivers_NationalityID (dbo.nationalities nationalityID)INTForeign Key to nationalities

Table Relationships

Drivers

Where Used

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

[dbo.drivers]

Parent_schemaNameParent_tableNameParent_columnNameSchematablecolumnconstraint_name
dbodriversdriverIddbopitStopsdriverIdFK_PitStops_DriverID
dbodriversdriverIddbolapTimesdriverIdFK_LapTimes_DriverID
dbodriversdriverIddbodriverStandingsdriverIdFK_DriverStandings_DriverID
dbodriversdriverIddbodriverNumbersdriverIDPK_driverNumbers_driverID
dbodriversdriverIddboresultDriverConstructordriverIDPK_resultDriverConstructor_driverID
dbodriversdriverIddboqualifyingdriverIdFK_Qualifying_DriverID

Example Query

SELECT 
[driverId]
,[driverRef]
,[number]
,[code]
,[forename]
,[surname]
,[dob]
,[url]
,n.[nationalityID]
,n.nationality
FROM
[dbo].[drivers] d

INNER JOIN [dbo].[nationalities] n
ON n.nationalityID = d.nationalityID

Example Output

driverIddriverRefnumbercodeforenamesurnamedoburlnationalityID
1hamilton44HAMLewisHamilton1985-01-07http://en.wikipedia.org/wiki/Lewis_Hamilton10
2heidfeld0HEINickHeidfeld1977-05-10http://en.wikipedia.org/wiki/Nick_Heidfeld21