1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Discuss in my forum

Primary Key Definition: What is a Primary Key?


Senior man working on PC at night
Yagi Studio/Taxi Japan/Getty Images
Definition: The primary key of a relational table uniquely identifies each record in the table. It can either be a normal attribute that is guaranteed to be unique (such as Social Security Number in a table with no more than one record per person) or it can be generated by the DBMS (such as a globally unique identifier, or GUID, in Microsoft SQL Server). Primary keys may consist of a single attribute or multiple attributes in combination.
Imagine we have a STUDENTS table that contains a record for each student at a university. The student's unique student ID number would be a good choice for a primary key in the STUDENTS table. The student's first and last name would not be a good choice, as there is always the chance that more than one student might have the same name.

For more information on keys, read the article Database Keys. For more on selecting appropriate primary keys for a table, read Choosing a Primary Key.
Related Video
Create Bullet, Number, and Definition Lists in HTML
  1. About.com
  2. Technology
  3. Databases

©2014 About.com. All rights reserved.