Data warehousing surrogate key: What is surrogate key? Explain it with an example.

What is surrogate key? Explain it with an example.

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 SK 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 SK is NOT derived from the data.

What is surrogate key? Explain it with an example.

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 warehousing Factless Fact Table: What is the purpose of Factless Fact Table?
What is the purpose of Fact less Fact Table? - Fact less tables are so called because they simply contain keys which refer to the dimension tables..........
Data warehousing: What is a level of Granularity of a fact table?
What is a level of Granularity of a fact table? - A fact table is usually designed at a low level of Granularity. This means that we need to find the lowest level of information.......
Data warehousing star & snowflake: Explain the difference between star and snowflake schemas.
Data warehousing star & snowflake - A snow flake schema design is usually more complex than a star schema. In a star schema a fact table is surrounded......
Post your comment