What is the purpose of using surrogate key

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

Hi friends , why use of surrogate key instead of using primary key , can anyone explain me with some simple examples

SHARE
Best Answer by Sharath Reddy
Answered By 0 points N/A #94765

What is the purpose of using surrogate key

qa-featured

Dear,

A surrogate key for the purpose of indexing table is used as a primary key. It takes less memory than primary key or surrogate key characters, but can only contain numbers. It's easy when you compare the number of characters to compare with.
The fact table surrogate keys used to establish a relationship between the dimensions will be. Impulse generator used surrogate keys. Data warehouses usually a surrogate, (also known as artificial or identity key), the primary keys of dimension tables for the use. The Info set for the surrogate key generator, or Oracle configuration, or you can use SQL Server identity values.
For example, some people mention the name of city or mention the name of airport. But by using airport I.D it will be more internal systematical base for the whole operating system.

Thank you.

Best Answer
Best Answer
Answered By 567105 points N/A #94766

What is the purpose of using surrogate key

qa-featured

In database, a “surrogate key” is a sole identifier for either an “object” in the database or an “entity” in the modeled world and is not obtained from the application data. There are two definitions of a surrogate in 1976 and in 1991. The first definition was in 1976 by Codd, Owlett, and Hall which states that a surrogate signifies an entity in the outside world.

It is created internally by the system but can still be seen by the user or by the application. The second definition was in 1991 by De Jonge and Wieringa that says a surrogate signifies an object in the database. It is also internally created but cannot be seen by the user or the application.

In the actual application, the surrogate key can be the primary key created by the database management system and not obtained from any application data of the database. Its only importance is to work as the primary key. In a temporal database, it is important to identify which is the primary key and which is the surrogate key.

Normally, every row contains a surrogate key and a primary key.

Login/Register to Answer

Related Questions