You are on page 1of 8

KEYS

Angelique L. Guce
BLIS-IV
Primary key


It is a special relational database
table column (or combination of
columns) designated to uniquely
identify all table records.
Main features of the
primary keys:
It must contain a unique
value for each row of
data.

It cannot contain null
values.

Almost all individuals deal with
primary keys frequently but unknowingly
in everyday life.

For example:
Students are routinely assigned
unique identification (ID) numbers, and all
adults receive government-assigned and
uniquely-identifiable Social Security
numbers.

For example:
A database must hold all of the
data stored by a commercial bank. Two
of the database tables include the
CUSTOMER_MASTER, which stores
basic and static customer data (e.g.,
name, date of birth, address and Social
Security number, etc.) and the
ACCOUNTS_MASTER, which stores
various bank account data (e.g.,
account creation date, account type,
withdrawal limits or corresponding
account information, etc.).


To uniquely identify customers, a
column or combination of columns is
selected to guarantee that two
customers never have the same
unique value. Thus, certain columns
are immediately eliminated, e.g.,
surname and date of birth.
A good primary key candidate is the column
that is designated to hold unique and
government-assigned Social Security
numbers. However, some account holders
(e.g., children) may not have Social Security
numbers, and this columns candidacy is
eliminated. The next logical option is to use a
combination of columns such as the surname
to the date of birth to the email address,
resulting in a long and cumbersome primary
key.




THANK YOU

You might also like