Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is surrogate key?

Answer Posted / venkat

surrogate key is a substitution for the natural primary key.

It is just a unique identifier or number for each row that
can be used for the primary key to the table. The only
requirement for a surrogate primary key is that it is
unique for each row in the table.

Data warehouses typically use a surrogate, (also known as
artificial or identity key), key for the dimension tables
primary keys. They can use Infa sequence generator, or
Oracle sequence, or SQL Server Identity values for the
surrogate key.

It is useful because the natural primary key (i.e. Customer
Number in Customer table) can change and this makes updates
more difficult.

Some tables have columns such as AIRPORT_NAME or CITY_NAME
which are stated as the primary keys (according to the
business users) but ,not only can these change, indexing on
a numerical value is probably better and you could consider
creating a surrogate key called, say, AIRPORT_ID. This
would be internal to the system and as far as the client is
concerned you may display only the AIRPORT_NAME.

2. Adapted from response by Vincent on Thursday, March 13,
2003

Another benefit you can get from surrogate keys (SID) is :

Tracking the SCD - Slowly Changing Dimension.

Let me give you a simple, classical example:

On the 1st of January 2002, Employee 'E1' belongs to
Business Unit 'BU1' (that's what would be in your Employee
Dimension). This employee has a turnover allocated to him
on the Business Unit 'BU1' But on the 2nd of June the
Employee 'E1' is muted from Business Unit 'BU1' to Business
Unit 'BU2.' All the new turnover have to belong to the new
Business Unit 'BU2' but the old one should Belong to the
Business Unit 'BU1.'

If you used the natural business key 'E1' for your employee
within your datawarehouse everything would be allocated to
Business Unit 'BU2' even what actualy belongs to 'BU1.'

If you use surrogate keys, you could create on the 2nd of
June a new record for the Employee 'E1' in your Employee
Dimension with a new surrogate key.

This way, in your fact table, you have your old data
(before 2nd of June) with the SID of the Employee 'E1'
+ 'BU1.' All new data (after 2nd of June) would take the
SID of the employee 'E1' + 'BU2.'

You could consider Slowly Changing Dimension as an
enlargement of your natural key: natural key of the
Employee was Employee Code 'E1' but for you it becomes
Employee Code + Business Unit - 'E1' + 'BU1' or 'E1'
+ 'BU2.' But the difference with the natural key
enlargement process, is that you might not have all part of
your new key within your fact table, so you might not be
able to do the join on the new enlarge key -> so you need
another id.




------------------------------------------------------------
--------------------

A surrogate key is a system generated sequential number
which acts as a primary key.

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are parallel querys and query hints?

2224


Explain are data mart and dwh normalized or denormalized? Do both of them exist in

1026


What are the different types of datawarehosuing?

989


How to export mappings to the production environment?

904


What is the metadata extension?

996


Which technology should be used for interactive data querying across multiple dimensions for a decision making for a dw?

1058


What is the difference between data warehouse and operational systems?

1136


how can one transfer LOB and user defined data from oracle to warehouse using ETL informaticabecause

2131


I know of using applysimple, but there are other ways too?

959


What is difference macros and prompts?

2303


Where the data cube technology is used?

959


What are the data types present in bo? What happens if we implement view in the designer n report?

932


what is the synchonus? wht is the diff between synchronous and asynchronous what is the diff between v1 and v2 v3 delta modes in sap ecc

2500


The same tier?

1053


What is the difference between drill through and masterdetail reports?

1154