0% found this document useful (0 votes)
496 views1 page

Primary Key Definition

A primary key uniquely identifies each record in a table and can consist of a single attribute like a student ID number or multiple attributes in combination. It ensures each row has a unique identifier and prevents duplicate records. Examples given show a student ID would be a better primary key for a student table than name attributes since names are not guaranteed to be unique per person. Additionally, a primary key column must contain only unique, non-null values to properly identify each row.

Uploaded by

Akhil Madavan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
496 views1 page

Primary Key Definition

A primary key uniquely identifies each record in a table and can consist of a single attribute like a student ID number or multiple attributes in combination. It ensures each row has a unique identifier and prevents duplicate records. Examples given show a student ID would be a better primary key for a student table than name attributes since names are not guaranteed to be unique per person. Additionally, a primary key column must contain only unique, non-null values to properly identify each row.

Uploaded by

Akhil Madavan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Primary Key Definition: What is a Primary

Key
efinition: 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.
Examples:

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.

OTHER DEFNITION
A primary key is a column (or columns) in a table that uniquely identifies the rows in that
table.

CUSTOMERS

CustomerNo FirstName LastName


1 Sally Thompson
2 Sally Henderson
3 Harry Henderson
4 Sandra Wellington

For example, in the table above, CustomerNo is the primary key.

The values placed in primary key columns must be unique for each row: no duplicates can be
tolerated. In addition, nulls are not allowed in primary key columns.

You might also like