Give an example of a surrogate key
Give an example of a surrogate key?
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.
Following characteristics:
1. It is typically an integer.
2. It has no meaning. You will not be able to know the meaning of that row of data based on the surrogate key value.
3. It is not visible to end-users. End users should not see a surrogate key in a report
Step by step
Solved in 2 steps