top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is a primary key and why it is used?

+2 votes
220 views
What is a primary key and why it is used?
posted Nov 12, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

A primary key is a special index which uniquely identifies a record, like enrollment number of a student identifies him in a university, account number in a bank etc etc.

Please see the characteristics in detail -
A primary key is implicitly UNIQUE - you cannot have more than one row with the same primary key, since its purpose is to uniquely identify rows.
A table can have only one primary key, every table should have one (not necessarily).
A primary key can never be NULL, so the row(s) it consists of must be NOT NULL.

answer Nov 12, 2014 by Salil Agrawal
+1 vote

1.The primary key is the columns used to uniquely identify each row of a table.
2.A table can have only one primary key, which may consist of single or multiple fields.
3.No primary key value can appear in more than one row in the table.
4.If a table has a primary key defined on any field(s), then you can not have two records having the same value of that field(s).

answer Nov 13, 2014 by Manikandan J
...