diff --git a/relational-data.Rmd b/relational-data.Rmd index 2c905ec..db70bab 100644 --- a/relational-data.Rmd +++ b/relational-data.Rmd @@ -109,7 +109,7 @@ There are two types of keys: For example, `flights$tailnum` is a foreign key because it appears in the `flights` table where it matches each flight to a unique plane. -A variable can be both a primary key _and_ a foreign key. For example, `origin` is part of the `weather` primary key, and is also a foreign key for the `airport` table. +A variable can be both a primary key _and_ a foreign key. For example, `origin` is part of the `weather` primary key, and is also a foreign key for the `airports` table. Once you've identified the primary keys in your tables, it's good practice to verify that they do indeed uniquely identify each observation. One way to do that is to `count()` the primary keys and look for entries where `n` is greater than one: