# Class 23: Relational Data

## Airline data

Today we will once again look at the NYC flights dataset:

This time we will also look at another table that describes each of the airlines.

These two tables are connected by way of a common shared variable, known in database theory as keys. A key may be a single variable or a collection of variables (known as a composite key).

In order to combine them, by matching up along keys, we can make use of the function left_join. Here we see that it returns a new table with the same number of rows as the flights_sml dataset but now with the full name of the carrier:

And the resulting dataset combines all of the variables by the common key.

## Practice

Today, work on the first lab concerned with the Chicago Crime data: lab23.Rmd