Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Name: Sana Salah_ud_din
M.Sc CS (final)
Roll#: 138005
Topic: Keys In Relational
Database
AT A Glance:
Ø
What is :
Ø
A Key ?
Ø
A Super Key ?
Ø
A Candidate Key ?
Ø
A Primary Key ?
Ø
An Alternate Key ?
Ø
relational Key:
 A KEY is an attribute or set
of attributes that uniquely
identifies a TUPLE in a relation.
 There are t...
Super Key:
 An attribute, or set of attributes, that uniquely
identifies a tuple within a relation.
 A Super key may con...
Candidate key:
 A key which is the candidate for being selected as a
primary key.
 A candidate key contains only the att...
Primary key:
 The candidate key that is selected to identify tuples
uniquely within the relation.
 Some most important p...
Alternate key:
 The candidate keys that are not selected as primary
key are known as alternate keys.
 As shown in the fi...
Composite Key:
 A primary key that consists of two or more attributes is
known as COMPOSITE KEY.
 As shown in the figu-
...
Foreign key:
 An attribute, or set of attributes, within one relation
that matches the candidate key of some relation..
...
The end
Upcoming SlideShare
Loading in …5
×
Upcoming SlideShare
ER Model in DBMS
Next
Download to read offline and view in fullscreen.

3

Share

Download to read offline

Relational keys

Download to read offline

Keys in a relational database

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Relational keys

  1. 1. Name: Sana Salah_ud_din M.Sc CS (final) Roll#: 138005 Topic: Keys In Relational Database
  2. 2. AT A Glance: Ø What is : Ø A Key ? Ø A Super Key ? Ø A Candidate Key ? Ø A Primary Key ? Ø An Alternate Key ? Ø
  3. 3. relational Key:  A KEY is an attribute or set of attributes that uniquely identifies a TUPLE in a relation.  There are two main types of key:  A Super Key  and a Foreign key Relational Keys Super Key Foreign Key Candidate Key Primary Key Alternate key Candidate Key
  4. 4. Super Key:  An attribute, or set of attributes, that uniquely identifies a tuple within a relation.  A Super key may contain additional attributes that are not necessary for unique identification.  A super key is the most general type of key. EXAMPLE:  As shown in the figure the relat- ion Branch has a super key
  5. 5. Candidate key:  A key which is the candidate for being selected as a primary key.  A candidate key contains only the attributes which can uniquely identify a tuple in a relation.  As shown in the figure --- in the relation Branch the attributes branchNo & postcode can serve as candidate keys because both can uniquely identify a tuple in
  6. 6. Primary key:  The candidate key that is selected to identify tuples uniquely within the relation.  Some most important points about primary key are:  A relation can have only one primary key.  Each value in primary key attribute must be unique.  Primary key cannot contain null values.  As shown in the figure---- the attribute branchNo can serve as primary key because
  7. 7. Alternate key:  The candidate keys that are not selected as primary key are known as alternate keys.  As shown in the figure the relation Branch has branchNo serving as pri- mary key and postcode serving as alternate key because postcode can
  8. 8. Composite Key:  A primary key that consists of two or more attributes is known as COMPOSITE KEY.  As shown in the figu- re– the relation Branch has two attributes serving as primary key so this is a composite key,
  9. 9. Foreign key:  An attribute, or set of attributes, within one relation that matches the candidate key of some relation..  As shown in the figur- e in the relation Staff The attribute branchNo is the foreign key because it is the prim- ary key in the relation Branch.
  10. 10. The end
  • SamirAskerov

    May. 25, 2021
  • TeymurEhmedov

    Mar. 28, 2021
  • asmaaliarain

    May. 11, 2016

Keys in a relational database

Views

Total views

5,027

On Slideshare

0

From embeds

0

Number of embeds

24

Actions

Downloads

189

Shares

0

Comments

0

Likes

3

×