Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 11

Click to edit Master title style

KEYS

By:-
Khushi Birla
1
Click to edit Master title style
Keys
• Keys play an important role in the relational
database.
• It is used to uniquely identify any record or
row of data from the table. It is also used to
establish and identify relationships between
tables.
• They basically help in identifying the
relationship between tables.

2 2
Click to edit Master title style
TYPES OF KEYS:-
1.Super Key
2.Candidate Key
3.Primary Key
4.Foreign Key

3 3
Click to edit Master title style
SUPER KEY

• Super key is an attribute set that can uniquely


identify a tuple. A super key is a superset of a
candidate key.
• A super key may contain additional attributes
that are not require for unique identification.

4 4
Click to edit Master title style
CANDIDATE KEY
• Candidate key is a subset of super key.
• A candidate is a single field or the least combination of
fields that uniquely identifies each record in a table.
• The candidate key must not be null.

5 5
Click to edit Master title
PRIMARY KEY style

• A Primary key is a subset of candidate key.


• Basically primary key is a candidate key chosen by
database administration for unique identification.
• A Primary key values can never be null.

6
Click to edit Master title style

Super key= {Emp id, Mobile No. , Email}


Candidate key= {Emp id, Mobile No.}
Primary key= {Emp id}

7 7
Click to edit Master title style

8 8
Click to edit Master title style
FOREIGN KEY
• Foreign keys are the column of the table used to point to
the primary key of another table.
• A foreign key is a primary key from one table that appears
as a field in another where the first table has a relationship
to the record.

9
Click to edit Master title style

1010
Click to edit Master title style

“THANK YOU!!
1111

You might also like