0% found this document useful (0 votes)
5 views

keys in dbms

The document discusses various types of keys in database management, including super keys, candidate keys, and alternate keys, highlighting their roles in uniquely identifying records within tables. It explains how these keys establish relationships between different tables, ensuring data integrity and organization. Additionally, examples are provided to illustrate the concepts of primary keys and composite keys.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

keys in dbms

The document discusses various types of keys in database management, including super keys, candidate keys, and alternate keys, highlighting their roles in uniquely identifying records within tables. It explains how these keys establish relationships between different tables, ensuring data integrity and organization. Additionally, examples are provided to illustrate the concepts of primary keys and composite keys.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

*keyg;-set attsi butes

it is used to uniguely identy any vecosd(


e dota fom the toble
it is alo uged to estobi'sh andJdentfy relakor
betuocen tobl es
Shudent Pex 80n

Name
DOB
Addoess pass pos t -umte
(OusSe
icense - Numbes

jn ehe Shudent table


becouse it is unique In the pexson tabJe, po
lg eacfh student. num be I i cense- numteð )
SSN. 1e lceyS since they
1e uniqwe fox each
peBSon:
Types ekeys:
1.4.Supes
`ucex key:- The set e one () mose txibutes (ce
totcon uniquely jdenty a tuple (300 co) Yeo)
knoon aS Suer lcey .
Employee
Employee -To
Fmpiogee -ome
passpox - numie
SSN
Te the e example tobie, (En ployee. TD, Enploye.
a (he ame too empl ou ee s can be the Some, but
el enogee.JD cant be the
ome.
Hi (ombnaton can algo be e eu
LOOu ld 6e emplyee- TD (Enployee. TO,
Smployee -Nome)
Cme- ID Emp.
fjoy
name
Empage Emp-email.10
Aijy@ gmai) com
mangy mang@gmcu con
103 Rahul sohul@gmalcom

Set e Supes lCeus obtined.

EmpTO, mpnanmey
EmpIO Emp-EmalTO
&Canidate cey:-The minimal set of attibutee -that can
snon al a
*A tondidate tey it o mínimal Super Keynomeanf n t can
o iecod but'conton eta attibte
togloyee'Detal:
tmp- ssN. Emp ID Emp- alame Emp-emall

1801 D2 Meg@gmalcoy
19801 03 R'ddle
41201 [email protected]
&et ct &uputus Obtaíned.
candidat
tmp- SSN
Tmp.1D
eeys itmp-6s}
Emp- îDt
tmp-tmail i emp- email?
tmp-sN,Emp-1D
SEmp-3D, Emp- name?
mp-ssA, émp-1D.Emp- emai?
)Emp.ssN,Emp- nla me. tmp- 1D}
NoT E:
table, we con have One s) náe than One candi d at
but e can (reate
table
3Phimaty tyiThere con be moe than One cordid ate
as
tiy
ion Out of obich One can be choosen

(onnt be NuLL

Supertey

Ex* 8tudent Ex

Rellnol Alame Ag Smplaye


cmployee.b
Bam employe-AMam
2 Ve da Enplagee. Addree!
Roga astpdt. Numbetcand
tHeneer Number
Tdeignyi Riy is an oHvibute in one toble
that netat to the pimau o 0ncthy table. Atatle
that cotainc -tfo

efesence tuble
Nameouwse
Tom "Tavo Marrs

9204Tshn 22 04
6S

2043-Aéce Pyhon Qo43 43


|Jo32ob Ohaele A032 62
tudent detafls &tudent mailcs
S
Autesnoe cey- An ndesnat ekey i
key in n oble thot s not any
’ An altenate key an
conaidat
choosen the pumay key.
o,
e
consist e one c ) mose ceumns
(ields)thot con uniquel i deni ao 1ecobd
s1ecobd, 6ut it
is, not the puoU key
Ernioye e
Employee To-poimvuytey ?. Con didate
Atesnote key
key

Stud J Rollno iostrame Jastome email


Tom
John
abc(@glcom
93 fice petes son
mno@gail(om
foimsyey AUtenaltve kes
Condi dot e key

rey: e) concotenoted keq


migt not hoVe a Singte
rdorno Jotibute thot nigely jdentifies atu the
Pumeykey consÀStso mne then On e ottada
t is compite key
knoLo a
hS key auso kooon as (oncate ted cey.
Ex (ompoaite key: i»stnome
dagt name
fix st nume mst name
Emp Rete
pog-Jp shipai
Yamini G1ouom
shipai Agnwa
Altesnate
leey
Heenu Aganoaa
Ea'Table unique fos etgn key
Icey E: Table
EmpIp Empname Empieense Emppaspt DID
Ro DID Deinaio
Tom PA 123 BPO
John EL I02
oo8 Alice EL I03
fA125 3 Acount
PAi29 TT

Ganditote key
foumy lcey Condi dote key
Altesnge kes
Supeskey

You might also like