parent
f0215486cc
commit
a182b874bd
|
@ -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:
|
||||
|
||||
|
|
Loading…
Reference in New Issue