Relational databases break data into separate tables, each containing a unique list of the items stored. A relational database is comprised of:
Tables: Data organized into sets of columns (fields) and rows (records).
Fields (aka Variables): The columns that contain descriptive characteristics about the observations in the table.
Records: The rows, with each observation corresponding to a record, or unique instance, of what is being described in the table.
A primary key is a field (variable) in a relational database that serves as a unique identifier.
In the Customers Table above, the field (variable) CustomerID is a primary key because it uniquely identifies each record. In the Transaction Table, the field (variable) CustomerID is also present. However, there are multiple records with the same CustomerID values. In the Transaction Table, the field (variable) CustomerID cannot uniquely identify a record by itself; some combination of CustomerID and Date, for example, uniquely identifies each record.
In the Transaction Table, therefore, CustomerID serves as a Foreign Key: a field (variable) that exists to create relationships between two tables, linking to the primary key in another table.