Tell me what is surrogate key

Asked By 25 points N/A Posted on -
qa-featured

Hello dear friends,

I have a question in mind and I want to get a solution. I tried my best, yet found no answers. Can anybody help me kindly in this case? What is a surrogate key? Pls. explain it with an example. I showed my problem to all of you. So please solve my problem as soon as possible.

Thanks in advance.

SHARE
Best Answer by john sena
Best Answer
Best Answer
Answered By 40 points N/A #128984

Tell me what is surrogate key

qa-featured

Hi,

John Sena is here.

A surrogate key is a unique identifier in database either for an entity in the modeled word or an object in the database. Application data is not used to derive surrogate key. Surrogate key is an internally generated key by the current system and is invisible to the user. As several objects are available in the database corresponding to surrogate, surrogate key can not be utilized as primary key.

For example, a sequential number can be a surrogate key. Data warehouses commonly use a surrogate key to uniquely identify an entity. A surrogate is not generated by the user but by the system. A primary difference between a primary key and surrogate key in few databases is that PK uniquely identifies a record while a surrogate key uniquely identifies an entity e.g. an employee may be recruited before the year 2000 while another employee with the same name may be recruited after the year 2000. Here, the primary key will uniquely identify the record while the surrogate key will be generated by the system (say a serial number) since the surrogate key is NOT derived from the data.

Wish you best of luck.

Related Questions