-- DBMS: bigquery
CREATE TABLE `bigquery-public-data.nhtsa_traffic_fatalities.pbtype_2018`
(
  state_number INT64 OPTIONS(description="This data element identifies the state in which the crash occurred. The codes are from the General Services Administration’s (GSA) publication of worldwide Geographic Location Codes (GLC). For more info on the codes, please look at <C1/V1/D1/PC1/P1/NM1 State Number> section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315"),
  state_name STRING OPTIONS(description="This data element identifies the state in which the crash occurred. The codes are from the General Services Administration’s (GSA) publication of worldwide Geographic Location Codes (GLC)."),
  consecutive_number INT64 OPTIONS(description="This data element is the unique case number assigned to each crash. It appears on each data file and is used to merge information from the data files together. xxxxxx Two Characters for State Code followed by Four Characters for Case Number"),
  vehicle_number INT64 OPTIONS(description="This data element is the consecutive number assigned to each vehicle in the case. This data element appears on each vehicle level data file and is used in conjunction with the ST_CASE data element to merge information from vehicle level data files. 000-999 Assigned Number of Motor Vehicle"),
  person_number INT64 OPTIONS(description="This data element is the consecutive number assigned to each person in the case (i.e., each occupant, pedestrian, or non-motorists involved in the crash). This data element appears on each person level data file and is used in conjunction with the ST_CASE data element (and sometimes the VEH_NO data element) to merge information from person level data files. 001-999 Assigned Person Number"),
  person_type INT64 OPTIONS(description="This data element describes the role of this person involved in the crash. For more info on the codes, please look at P7/NM7 Person Type section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315"),
  person_type_name STRING OPTIONS(description="This data element describes the role of this person involved in the crash. For more info on the codes, please look at P7/NM7 Person Type section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315"),
  age INT64 OPTIONS(description="This data element identifies the person’s age, in years, with respect to the person's last birthday. 000 Less than One Year 001-120 Age of the Individual in Years 998 Not Reported 999 Unknown"),
  age_name STRING OPTIONS(description="This data element identifies the person’s age, in years, with respect to the person's last birthday. 000 Less than One Year 001-120 Age of the Individual in Years 998 Not Reported 999 Unknown"),
  sex STRING OPTIONS(description="This data element identifies the sex of the person involved in the crash. 1 Male 2 Female 8 Not Reported 9 Unknown"),
  sex_name STRING OPTIONS(description="This data element identifies the sex of the person involved in the crash. 1 Male 2 Female 8 Not Reported 9 Unknown"),
  marked_crosswalk_present STRING OPTIONS(description="This data element indicates if a marked crosswalk was present at the crash site. 0 None Noted 1 Yes 9 Unknown"),
  marked_crosswalk_present_name STRING OPTIONS(description="This data element indicates if a marked crosswalk was present at the crash site. 0 None Noted 1 Yes 9 Unknown"),
  sidewalk_present STRING OPTIONS(description="This data element indicates if a sidewalk was present at the crash site. 0 None Noted 1 Yes 9 Unknown"),
  sidewalk_present_name STRING OPTIONS(description="This data element indicates if a sidewalk was present at the crash site. 0 None Noted 1 Yes 9 Unknown"),
  school_zone STRING OPTIONS(description="This data element indicates if the crash occurred in a school zone. 0 None Noted 1 Yes 9 Unknown"),
  school_zone_name STRING OPTIONS(description="This data element indicates if the crash occurred in a school zone. 0 None Noted 1 Yes 9 Unknown"),
  crash_type_pedestrian INT64 OPTIONS(description="This data element summarizes the circumstances of the crash for this pedestrian. For more info on the codes, please look at NM9-PB30 Crash Type – Pedestrian section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315"),
  crash_type_pedestrian_name STRING OPTIONS(description="This data element summarizes the circumstances of the crash for this pedestrian. For more info on the codes, please look at NM9-PB30 Crash Type – Pedestrian section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315"),
  crash_type_bicycle INT64 OPTIONS(description="This data element summarizes the circumstances of the crash for this bicyclist. For more info on the codes, please look at NM9-PB30B Crash Type – Bicycle section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315"),
  crash_type_bicycle_name STRING OPTIONS(description="This data element summarizes the circumstances of the crash for this bicyclist. For more info on the codes, please look at NM9-PB30B Crash Type – Bicycle section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315"),
  crash_location_pedestrian STRING OPTIONS(description="This data element identifies where the pedestrian crash occurred with respect to an intersection. 1 At Intersection 2 Intersection-Related 3 Not At Intersection 4 Non-Trafficway Location 7 Not a Pedestrian 9 Unknown/Insufficient Information"),
  crash_location_pedestrian_name STRING OPTIONS(description="This data element identifies where the pedestrian crash occurred with respect to an intersection. 1 At Intersection 2 Intersection-Related 3 Not At Intersection 4 Non-Trafficway Location 7 Not a Pedestrian 9 Unknown/Insufficient Information"),
  crash_location_bicycle STRING OPTIONS(description="This data element identifies where the bicyclist crash occurred with respect to an intersection. 1 At Intersection 2 Intersection-Related 3 Not At Intersection 4 Non-Trafficway Location 7 Not a Cyclist 9 Unknown/Insufficient Information"),
  crash_location_bicycle_name STRING OPTIONS(description="This data element identifies where the bicyclist crash occurred with respect to an intersection. 1 At Intersection 2 Intersection-Related 3 Not At Intersection 4 Non-Trafficway Location 7 Not a Cyclist 9 Unknown/Insufficient Information"),
  pedestrian_position STRING OPTIONS(description="This data element identifies the position/location of the pedestrian with respect to the trafficway when contacted. 1 Intersection Area 2 Crosswalk Area 3 Travel Lane 4 Paved Shoulder/Bicycle Lane/Parking Lane 5 Sidewalk/Shared-Use Path/Driveway Access 6 Unpaved Right-of-Way 7 Non-Trafficway – Driveway 8 Non-Trafficway – Parking Lot/Other 9 Other/Unknown 77 Not a Pedestrian"),
  pedestrian_position_name STRING OPTIONS(description="This data element identifies the position/location of the pedestrian with respect to the trafficway when contacted. 1 Intersection Area 2 Crosswalk Area 3 Travel Lane 4 Paved Shoulder/Bicycle Lane/Parking Lane 5 Sidewalk/Shared-Use Path/Driveway Access 6 Unpaved Right-of-Way 7 Non-Trafficway – Driveway 8 Non-Trafficway – Parking Lot/Other 9 Other/Unknown 77 Not a Pedestrian"),
  bicyclist_position STRING OPTIONS(description="This data element identifies the position/location of the bicyclist with respect to the trafficway when contacted. 1 Travel Lane 2 Bicycle Lane/Paved Shoulder/Parking Lane 3 Sidewalk/Crosswalk/Driveway Access 4 Shared-Use Path 5 Non-Trafficway – Driveway 6 Non-Trafficway – Parking Lot/Other 7 Not a Cyclist 8 Other 9 Unknown"),
  bicyclist_position_name STRING OPTIONS(description="This data element identifies the position/location of the bicyclist with respect to the trafficway when contacted. 1 Travel Lane 2 Bicycle Lane/Paved Shoulder/Parking Lane 3 Sidewalk/Crosswalk/Driveway Access 4 Shared-Use Path 5 Non-Trafficway – Driveway 6 Non-Trafficway – Parking Lot/Other 7 Not a Cyclist 8 Other 9 Unknown"),
  pedestrian_initial_direction_of_travel STRING OPTIONS(description="This data element identifies the initial direction of travel of the pedestrian prior to being contacted in the crash. 1 Northbound 2 Eastbound 3 Southbound 4 Westbound 7 Not a Pedestrian 8 Not Applicable 9 Unknown Initial Direction of Travel"),
  pedestrian_initial_direction_of_travel_name STRING OPTIONS(description="This data element identifies the initial direction of travel of the pedestrian prior to being contacted in the crash. 1 Northbound 2 Eastbound 3 Southbound 4 Westbound 7 Not a Pedestrian 8 Not Applicable 9 Unknown Initial Direction of Travel"),
  bicyclist_initial_direction_of_travel STRING OPTIONS(description="This data element identifies the initial travel direction of the bicyclist with respect to the flow of traffic prior to being contacted in the crash. 1 With Traffic 2 Facing Traffic 3 Not Applicable 7 Not a Cyclist 9 Unknown"),
  bicyclist_initial_direction_of_travel_name STRING OPTIONS(description="This data element identifies the initial travel direction of the bicyclist with respect to the flow of traffic prior to being contacted in the crash. 1 With Traffic 2 Facing Traffic 3 Not Applicable 7 Not a Cyclist 9 Unknown"),
  motorist_initial_direction_of_travel STRING OPTIONS(description="This data element identifies the initial direction of travel of the motorist prior to being involved in a pedestrian crash. 1 Northbound 2 Eastbound 3 Southbound 4 Westbound 7 Not a Pedestrian 8 Not Applicable 9 Unknown Initial Direction of Travel"),
  motorist_initial_direction_of_travel_name STRING OPTIONS(description="This data element identifies the initial direction of travel of the motorist prior to being involved in a pedestrian crash. 1 Northbound 2 Eastbound 3 Southbound 4 Westbound 7 Not a Pedestrian 8 Not Applicable 9 Unknown Initial Direction of Travel"),
  motorist_maneuver STRING OPTIONS(description="This data element identifies if the motorist was engaged in a turning maneuver at an intersection prior to being involved in a pedestrian crash. The data element indicates the maneuver being made by the motorist at the time of a pedestrian collision. 1 Left Turn 2 Right Turn 3 Straight Through 7 Not a Pedestrian 8 Not Applicable 9 Unknown Motorist Maneuver"),
  motorist_maneuver_name STRING OPTIONS(description="This data element identifies if the motorist was engaged in a turning maneuver at an intersection prior to being involved in a pedestrian crash. The data element indicates the maneuver being made by the motorist at the time of a pedestrian collision. 1 Left Turn 2 Right Turn 3 Straight Through 7 Not a Pedestrian 8 Not Applicable 9 Unknown Motorist Maneuver"),
  intersection_leg STRING OPTIONS(description="The data element identifies the leg of the intersection where the pedestrian crash occurred. 1 Nearside 2 Farside 7 Not a Pedestrian 8 Not Applicable 9 Unknown"),
  intersection_leg_name STRING OPTIONS(description="The data element identifies the leg of the intersection where the pedestrian crash occurred. 1 Nearside 2 Farside 7 Not a Pedestrian 8 Not Applicable 9 Unknown"),
  pedestrian_scenario STRING OPTIONS(description="This data element identifies the location and travel directions of the motorist and pedestrian for those crashes that occur at intersections. This data element summarizes the movements of the pedestrian and motorist in an intersection area. For more info on the codes, please look at NM9-PB37 Pedestrian Scenario section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315"),
  pedestrian_scenario_name STRING OPTIONS(description="This data element identifies the location and travel directions of the motorist and pedestrian for those crashes that occur at intersections. This data element summarizes the movements of the pedestrian and motorist in an intersection area. For more info on the codes, please look at NM9-PB37 Pedestrian Scenario section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315"),
  crash_group_pedestrian INT64 OPTIONS(description="This data element provides general groupings of the more specific individual Pedestrian Crash Types. For more info on the codes, please look at NM9-PB38 Crash Group – Pedestrian section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315"),
  crash_group_pedestrian_name STRING OPTIONS(description="This data element provides general groupings of the more specific individual Pedestrian Crash Types. For more info on the codes, please look at NM9-PB38 Crash Group – Pedestrian section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315"),
  crash_group_bicycle INT64 OPTIONS(description="This data element provides general groupings of the more specific individual Bicyclist Crash Types. For more info on the codes, please look at NM9-PB38B Crash Group – Bicycle section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315"),
  crash_group_bicycle_name STRING OPTIONS(description="This data element provides general groupings of the more specific individual Bicyclist Crash Types. For more info on the codes, please look at NM9-PB38B Crash Group – Bicycle section in the pdf: https://crashstats.nhtsa.dot.gov/Api/Public/ViewPublication/812315")
);

INSERT INTO `bigquery-public-data.nhtsa_traffic_fatalities.pbtype_2018` (state_number, state_name, consecutive_number, vehicle_number, person_number, person_type, person_type_name, age, age_name, sex, sex_name, marked_crosswalk_present, marked_crosswalk_present_name, sidewalk_present, sidewalk_present_name, school_zone, school_zone_name, crash_type_pedestrian, crash_type_pedestrian_name, crash_type_bicycle, crash_type_bicycle_name, crash_location_pedestrian, crash_location_pedestrian_name, crash_location_bicycle, crash_location_bicycle_name, pedestrian_position, pedestrian_position_name, bicyclist_position, bicyclist_position_name, pedestrian_initial_direction_of_travel, pedestrian_initial_direction_of_travel_name, bicyclist_initial_direction_of_travel, bicyclist_initial_direction_of_travel_name, motorist_initial_direction_of_travel, motorist_initial_direction_of_travel_name, motorist_maneuver, motorist_maneuver_name, intersection_leg, intersection_leg_name, pedestrian_scenario, pedestrian_scenario_name, crash_group_pedestrian, crash_group_pedestrian_name, crash_group_bicycle, crash_group_bicycle_name) VALUES (1, 'Alabama', 10183, 0, 1, 6, 'Bicyclist', 48, '48 Years', '2', 'Female', '0', 'None Noted', '0', 'None Noted', '0', 'None Noted', 0, 'Not a Pedestrian', 255, 'Wrong-Way / Wrong-Side - Motorist', '7', 'Not a Pedestrian', '3', 'Not At Intersection', '77', 'Not a Pedestrian', '2', 'Bicycle Lane / Paved Shoulder / Parking Lane', '7', 'Not a Pedestrian', '1', 'With Traffic', '7', 'Not a Pedestrian', '7', 'Not a Pedestrian', '7', 'Not a Pedestrian', '7', 'Not a Pedestrian', 0, 'Not a Pedestrian', 258, 'Wrong-Way / Wrong-Side'), (1, 'Alabama', 10257, 0, 1, 6, 'Bicyclist', 40, '40 Years', '1', 'Male', '0', 'None Noted', '0', 'None Noted', '0', 'None Noted', 0, 'Not a Pedestrian', 231, 'Motorist Overtaking - Undetected Bicyclist', '7', 'Not a Pedestrian', '3', 'Not At Intersection', '77', 'Not a Pedestrian', '1', 'Travel Lane', '7', 'Not a Pedestrian', '1', 'With Traffic', '7', 'Not a Pedestrian', '7', 'Not a Pedestrian', '7', 'Not a Pedestrian', '7', 'Not a Pedestrian', 0, 'Not a Pedestrian', 230, 'Motorist Overtaking Bicyclist'), (1, 'Alabama', 10349, 0, 1, 6, 'Bicyclist', 75, '75 Years', '1', 'Male', '0', 'None Noted', '0', 'None Noted', '0', 'None Noted', 0, 'Not a Pedestrian', 129, 'Bicyclist Lost Control - Other / Unknown', '7', 'Not a Pedestrian', '3', 'Not At Intersection', '77', 'Not a Pedestrian', '1', 'Travel Lane', '7', 'Not a Pedestrian', '1', 'With Traffic', '7', 'Not a Pedestrian', '7', 'Not a Pedestrian', '7', 'Not a Pedestrian', '7', 'Not a Pedestrian', 0, 'Not a Pedestrian', 110, 'Loss of Control / Turning Error'), (1, 'Alabama', 10496, 0, 1, 6, 'Bicyclist', 61, '61 Years', '1', 'Male', '0', 'None Noted', '1', 'Yes', '0', 'None Noted', 0, 'Not a Pedestrian', 221, 'Bicyclist Left Turn - Same Direction', '7', 'Not a Pedestrian', '3', 'Not At Intersection', '77', 'Not a Pedestrian', '1', 'Travel Lane', '7', 'Not a Pedestrian', '1', 'With Traffic', '7', 'Not a Pedestrian', '7', 'Not a Pedestrian', '7', 'Not a Pedestrian', '7', 'Not a Pedestrian', 0, 'Not a Pedestrian', 220, 'Bicyclist Left Turn / Merge'), (1, 'Alabama', 10548, 0, 1, 6, 'Bicyclist', 70, '70 Years', '1', 'Male', '0', 'None Noted', '0', 'None Noted', '0', 'None Noted', 0, 'Not a Pedestrian', 231, 'Motorist Overtaking - Undetected Bicyclist', '7', 'Not a Pedestrian', '3', 'Not At Intersection', '77', 'Not a Pedestrian', '1', 'Travel Lane', '7', 'Not a Pedestrian', '1', 'With Traffic', '7', 'Not a Pedestrian', '7', 'Not a Pedestrian', '7', 'Not a Pedestrian', '7', 'Not a Pedestrian', 0, 'Not a Pedestrian', 230, 'Motorist Overtaking Bicyclist');