SQL Scratchpad
Run arbitrary SQL against either database. Press ⌘/Ctrl + Enter to run.
Pacific Northwest towns & counties
Tables: pnw_towns, pnw_counties, fips.
Text description of this diagram
Three tables and two helper views.
pnw_towns— one row per town. Columns:town,state,primary_county,secondary_county,tertiary_county,population_2020_census,population_2010_census,land_area_sq_mi.pnw_counties— one row per county. Columns:county,state,fips_short,county_seat,year_established,origin,etymology,population_2022,land_area_sq_mi.fips— FIPS state codes. Columns:fips,name,state.
Relationships: a town's primary_county corresponds to a county in pnw_counties. Both tables share a state column that joins to fips.state.
Pacific Northwest flights
Tables: airlines, airports, flights, planes, weather.
Text description of this diagram
Five tables centred on flights.
airlines— one row per carrier. Columns:carrier(PK),name.airports— one row per airport. Columns:faa(PK),name,lat,lon,alt,tz,dst,tzone.flights— one row per scheduled flight. Columns:year,month,day,dep_time,sched_dep_time,dep_delay,arr_time,sched_arr_time,arr_delay,carrier,flight,tailnum,origin,dest,air_time,distance,hour,minute,time_hour.planes— one row per aircraft. Columns:tailnum(PK),year,type,manufacturer,model,engines,seats,speed,engine.weather— hourly observations per origin airport. Columns:origin,year,month,day,hour,temp,dewp,humid,wind_dir,wind_speed,wind_gust,precip,pressure,visib,time_hour.
Relationships: flights.carrier → airlines.carrier; flights.origin → airports.faa; flights.dest → airports.faa; flights.tailnum → planes.tailnum; weather.origin → airports.faa.