In database design, it is a good practice to have a primary key for each table. There are two ways to specify a primary key: The first is to use part of the data as the primary key. For example, a table that includes information on employees may use Social Security Number as the primary key. This type of key is called a natural key. The second is to use a new field with artificially-generated values whose sole purpose is to be used as a primary key. This is called a surrogate key.
A surrogate key has the following characteristics:
Here is the browser market share for January 2013, based on traffic to my top site (number in parentheses shows change from December 2012):
Google Chrome: 37.09% (-0.71%)
IE: 30.90% (+1.18%)
Firefox: 26.18% (-0.19%)
Safari: 2.99% (-0.08%)
Opera: 1.23% (-0.18%)
Composite key, or composite primary key, refers to cases where more than one column is used to specify the primary key of a table. In such cases, all foreign keys will also need to include all the columns in the composite key. Note that the columns that make up a composite key can be of different data types.
Below is the SQL syntax for specifying a composite key: