dbTalk Databases Forums  

Surrogate and Natural Keys

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Surrogate and Natural Keys in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
 
Posts: n/a

Default Surrogate and Natural Keys - 10-05-2004 , 12:17 PM






I've been researching what Natural and Surrogate keys are
in the web and really can't find a straight and clear
answer. Does anyone want to take a crack at it?

Reply With Quote
  #2  
Old   
Jamie
 
Posts: n/a

Default RE: Surrogate and Natural Keys - 10-05-2004 , 01:11 PM






A surrogate key is a unique identifier assigned to a entity in a dimension
table. it has no real-world meaning.
A natural key identifies an entity in the real-world

Its probably better explained with an example.
A bank may have a data warehouse relating to all its customers - for
argument's sake lets say they identify all those users by their account
number (call it account_no). When the custotmers are loaded into the
appropriate dimension table they will be assigned a number (call it CustID)
that uniquely identifies that record. If you are modelling your customer
dimension as a type-2 dimension then you may find that you will later load a
second record in for a particular user. That record would contain the same
account_no but would have a new CustID assigned.
[Don't worry about that a type-2 dimension is for now.]

In this example account_no is the natural key and CustID is the surrogate key.


Thats my interpretation of them anyway. Hope I haven't baffled you.

Regards
Jamie Thomson
http://www.conchango.com


"anonymous (AT) discussions (DOT) microsoft.com" wrote:

Quote:
I've been researching what Natural and Surrogate keys are
in the web and really can't find a straight and clear
answer. Does anyone want to take a crack at it?


Reply With Quote
  #3  
Old   
 
Posts: n/a

Default RE: Surrogate and Natural Keys - 10-05-2004 , 01:39 PM



OK, so you are saying that the surrogate key is basically
an identity that really has no meaning, no rhyme or
reason or relationship to anything?

Quote:
-----Original Message-----
A surrogate key is a unique identifier assigned to a
entity in a dimension
table. it has no real-world meaning.
A natural key identifies an entity in the real-world

Its probably better explained with an example.
A bank may have a data warehouse relating to all its
customers - for
argument's sake lets say they identify all those users
by their account
number (call it account_no). When the custotmers are
loaded into the
appropriate dimension table they will be assigned a
number (call it CustID)
that uniquely identifies that record. If you are
modelling your customer
dimension as a type-2 dimension then you may find that
you will later load a
second record in for a particular user. That record
would contain the same
account_no but would have a new CustID assigned.
[Don't worry about that a type-2 dimension is for now.]

In this example account_no is the natural key and CustID
is the surrogate key.


Thats my interpretation of them anyway. Hope I haven't
baffled you.

Regards
Jamie Thomson
http://www.conchango.com


"anonymous (AT) discussions (DOT) microsoft.com" wrote:

I've been researching what Natural and Surrogate keys
are
in the web and really can't find a straight and clear
answer. Does anyone want to take a crack at it?

.


Reply With Quote
  #4  
Old   
Jamie
 
Posts: n/a

Default RE: Surrogate and Natural Keys - 10-05-2004 , 01:47 PM



Correct. It has no real-word meaning.

Regards
Jamie Thomson

"anonymous (AT) discussions (DOT) microsoft.com" wrote:

Quote:
OK, so you are saying that the surrogate key is basically
an identity that really has no meaning, no rhyme or
reason or relationship to anything?

-----Original Message-----
A surrogate key is a unique identifier assigned to a
entity in a dimension
table. it has no real-world meaning.
A natural key identifies an entity in the real-world

Its probably better explained with an example.
A bank may have a data warehouse relating to all its
customers - for
argument's sake lets say they identify all those users
by their account
number (call it account_no). When the custotmers are
loaded into the
appropriate dimension table they will be assigned a
number (call it CustID)
that uniquely identifies that record. If you are
modelling your customer
dimension as a type-2 dimension then you may find that
you will later load a
second record in for a particular user. That record
would contain the same
account_no but would have a new CustID assigned.
[Don't worry about that a type-2 dimension is for now.]

In this example account_no is the natural key and CustID
is the surrogate key.


Thats my interpretation of them anyway. Hope I haven't
baffled you.

Regards
Jamie Thomson
http://www.conchango.com


"anonymous (AT) discussions (DOT) microsoft.com" wrote:

I've been researching what Natural and Surrogate keys
are
in the web and really can't find a straight and clear
answer. Does anyone want to take a crack at it?

.



Reply With Quote
  #5  
Old   
Jamie Thomson
 
Posts: n/a

Default RE: Surrogate and Natural Keys - 10-07-2004 , 09:15 AM



World not word!!!

"Jamie" wrote:

Quote:
Correct. It has no real-word meaning.

Regards
Jamie Thomson

"anonymous (AT) discussions (DOT) microsoft.com" wrote:

OK, so you are saying that the surrogate key is basically
an identity that really has no meaning, no rhyme or
reason or relationship to anything?

-----Original Message-----
A surrogate key is a unique identifier assigned to a
entity in a dimension
table. it has no real-world meaning.
A natural key identifies an entity in the real-world

Its probably better explained with an example.
A bank may have a data warehouse relating to all its
customers - for
argument's sake lets say they identify all those users
by their account
number (call it account_no). When the custotmers are
loaded into the
appropriate dimension table they will be assigned a
number (call it CustID)
that uniquely identifies that record. If you are
modelling your customer
dimension as a type-2 dimension then you may find that
you will later load a
second record in for a particular user. That record
would contain the same
account_no but would have a new CustID assigned.
[Don't worry about that a type-2 dimension is for now.]

In this example account_no is the natural key and CustID
is the surrogate key.


Thats my interpretation of them anyway. Hope I haven't
baffled you.

Regards
Jamie Thomson
http://www.conchango.com


"anonymous (AT) discussions (DOT) microsoft.com" wrote:

I've been researching what Natural and Surrogate keys
are
in the web and really can't find a straight and clear
answer. Does anyone want to take a crack at it?

.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.