Skip to content

Instantly share code, notes, and snippets.

@vingkan
Created March 6, 2019 03:50
Show Gist options
  • Save vingkan/db7f6482b05a74d8b804ae115b6a96de to your computer and use it in GitHub Desktop.
Save vingkan/db7f6482b05a74d8b804ae115b6a96de to your computer and use it in GitHub Desktop.
Solution to 20 questions with the traffic crash dataset.
SELECT RD_NO
WHERE weather_condition = "RAIN"
AND crash_type = "INJURY AND / OR TOW DUE TO CRASH"
AND (INJURIES_FATAL = 0 or injuries_fatal is null)
AND crash_hour IN (13,14,15)
AND DAMAGE = "OVER $1,500"
and first_CRASH_type not in ('REAR END','TURNING'
,'ANGLE', 'PARKED MOTOR VEHICLE', 'HEAD ON'
, 'FIXED OBJECT', "SIDESWIPE SAME DIRECTION")
AND STREET_DIRECTION in ("E","W")
AND TRAFFICWAY_TYPE = "DIVIDED - W/MEDIAN BARRIER"
AND STREET_NAME = "ERIE ST"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment