In database design, a primary key is a value that can be used to identify a unique row in a table. Attributes are associated with it. Examples of primary keys are social security numbers (associated to a specific person) or ISBN numbers (associated to a specific book).
In the relational model of data, a primary key is a candidate key chosen as the main method of uniquely identifying a tuple in a relation. Practical telephone books and dictionaries cannot use names or words or Dewey Decimal System numbers as candidate keys because they do not uniquely identify telephone numbers or words.
In some design situations it is impossible to find a natural key that uniquely identifies a tuple in a relation. A surrogate key can be used as the primary key. In other situations there may be more than one candidate key for a relation, and no candidate key is obviously preferred. A surrogate key may be used as the primary key to avoid giving one candidate key artificial primacy over the others.
In addition to the requirement that the primary key be a candidate key, there are several other factors which may make a particular choice of key better than others for a given relation:
Primární klíč | Schlüssel (Datenbank) | Clé primaire | 主キー | Klucz głóny | Первичный ключ | Primárny kľúč
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Primary key".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world