Taken from a SITE POINT BOOK: SIMPLY SQL BY Rudy Limeback chapter 10
A key is simply the terminology we use in databases to mean an identifier:
a means to identify, unambiguously and uniquely, a particular instance of an entity. When we store or retrieve data in a database table that contains entities, each instance must be uniquely distinguished from every other instance of the same type of entity. This can only be done with a key that has unique values for all instances.
A KEY EXAMPLE:
For example, we’ve seen SQL queries with identifiers such as customer_id and forum_id. These identifiers are valid keys because every instance, every value, represents a different entity. All the values are unique. It’s unlikely we’d ever think of assigning the same customer_id value to two different customers, nor the same forum_id value to two different forums. Is this too obvious? It seems like only common sense, and, yes, it really is that simple.
So these examples of identifiers are unique keys. Then what is a primary key? A primary key is simply any one of the keys that an entity may have. The reason we need to pick one of these keys, and designate it as the primary key, is so that foreign keys or related entities will have a designated key that they can relate to.
PRIMARY KEY EXAMPLE:
Take you, for example: what is it about you that identifies you? your name is not a good key, because others may share the same name. Some possible keys that would be unique might be a representation of your fingerprints, or your retinal pattern, or even your DNA sequence. Let’s leave aside for the moment some obvious questions of practicality—such as whether these identifiers could be forged, whether they’re accurate enough, or even what to do about identical twins—and concentrate only on their uniqueness. Assuming for the sake of argument that we accept these identifiers as being capable of uniquely identifying every person in our application, we now have three unique keys to choose from. We pick one of them—even if we plan to store all three—and call it the primary key.
Hope this helps!:D