Join types

JOIN

  • match all rows from the first table only if there is a match on the second table

LEFT JOIN

  • match all rows from the first table regardless of whether there is a match on the second table
  • RIGHT JOIN: opposite of LEFT JOIN

OUTER JOIN

  • match all rows from both tables regardless of whether there is a match on the other table

CROSS JOIN

  • all possible pairs from the two tables
  • e.g. finding all possible edges in a graph:
    • CROSS JOIN the edge list with itself

Activity

Questions

Use the airlines database to answer the following questions.

  1. Find the names of all of the carriers that left Bradley International Airport on June 15th, 2013.

  2. Find all the carriers that fly out of Bradley International Airport and list them by number of flights.

  3. Find all the names of all of the carriers that fly out of Bradley International Airport and list them by number of flights.

  4. What model of plane is most common at Bradley?

  5. What model of plane is most common at Bradley? This time group the model numbers before the -.