Surrogate key
A key generated by a system only to identify a row, with no meaning outside it: a running number, or a random unique ID.
Because it means nothing, it never has to change. It also does nothing to prevent duplicates: the same customer entered twice simply receives two different keys.
Where it comes up
- Near-duplicate recordsTwo rows describe the same real thing but differ enough that an exact comparison misses them.
- The same entity in two systemsOne person or organization exists in two systems under different identifiers, with nothing linking the records.
See also
- Natural keyA key made from a value that already means something outside the database, such as an email address, a tax number, or a vehicle identification number.
- Primary keyA column, or set of columns, whose value is unique for every row and identifies it: a customer number, an order ID.
- IdentifierA value whose job is to name one particular thing, such as an account number, a part number, or a postal code. It is a label, even when it is made entirely of digits.