natural key and primary key [Resolved]

Posted by Sriharim under Sql Server on 5/13/2015 | Points: 10 | Views : 402 | Status : [Member] | Replies : 3
What is the difference between natural key and primary key in sql server ?

Natural key can be achieved/implement by Primary Key and Unique Key ? is there any other ways to create natural key ?

Does All Unique Keys are Natural Keys ? and All primary keys are Natural Key ?

Bussiness Key and Natural Key are both same ?

---
Srihari



Responses

Posted by: Sheonarayan on: 5/13/2015 [Administrator] HonoraryPlatinum | Points: 50

Up
0
Down

Resolved
Natural Key or Business Key


Natural key is a key that is formed of attributes or data that already exists in the real world and is the part of the database table.

For example: If we are storing Aadhar Card Number along with other details of a person into the database table, the Aadahar Card Number can be called as Natural Key as this will be unique to each record and Aadhar card number can't be same to more than one person. Also Aadhar card number of a person doesn't exists only in that database environment but also in the real world.

Natural Key and Business Key is same.

Primary Key

Primary Key or Unique key has no relationship with the data in real world and its relationship can't be determined outside the database environment.

For example: A auto increment column of the database table can be primary key whose value has nothing to do that particular record in the real world or outside the database environment.



Regards,
Sheo Narayan
http://www.dotnetfunda.com

Sriharim, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sriharim on: 5/14/2015 [Member] Starter | Points: 25

Up
0
Down
Thanx for reply, please clarify on below
A retail businesses (example: Relaince, payback cards) will store the customer details in a table and table has columns CustomerID, Customername, city,state,mobille number. Here, customer id is unique and can't be same to more than one person.

Whenever, i do shopping , i will give my mobile number or CustomerID and they will updated the points to my CustomerID .
Here, CustomerID exists in real world ,

Can i call the CustomerID has a natural key ?


Like same, bank account number will be unique.
Bank account number also natural key/business key ?

---
Srihari

Sriharim, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sriharim on: 5/17/2015 [Member] Starter | Points: 25

Up
0
Down
please clarify on previous post (dated 5/14/2015 below)

---
Srihari

Sriharim, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response