SQL Tutorial

Filtering Techniques

📚 Schema reference · PNW flights 5 tables
airlines
  • carrier
  • name
airports
  • faa
  • name
  • lat
  • lon
  • alt
  • tz
  • dst
  • tzone
flights
  • 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
  • tailnum
  • year
  • type
  • manufacturer
  • model
  • engines
  • seats
  • speed
  • engine
weather
  • origin
  • year
  • month
  • day
  • hour
  • temp
  • dewp
  • humid
  • wind_dir
  • wind_speed
  • wind_gust
  • precip
  • pressure
  • visib
  • time_hour

Filtering rows/records

  1. Select Boeing Planes’ Tail Numbers and Models
  1. Select airports (faa, name, lat) above 40 latitude and in the America/New_York time zone.
  1. Select airports (faa code, name, and lat) within 40 to 42 degrees latitude.

Filtering text

  1. Select airlines (carrier code and name) with name starting with an “A”
  1. Select the tail numbers (tailnum) of flights having 101 as the second, third, and fourth characters of the tail number.
  1. Select flights (all columns) where the carrier is either “AS” or “HA”
  1. Select weather records (all columns) where wind direction is missing
  1. Select weather records (all columns) where temperature is not missing