DBMS_UNIT_2_MINORS-part-1
DBMS_UNIT_2_MINORS-part-1
DBMS_UNIT_2_MINORS-part-1
Ex :
3 Swetha Nellore 9156253131 26
1 C1 DBMS
2 C2 Computer Networks
1 C2 Computer Networks
Properties of a Primary Key
• The Primary Key field shouldn’t be left NULL.
• The Primary Key column must contain a value.
• In that column, no two rows in the table may contain identical
values.
• If a foreign key in a DBMS refers to the primary Key, no value
may be altered or modified in this primary key column.
Example:
M ay be
U ni quel y D at a C reat
com pl ex
Pri ma i dent i fi e Not i nt egri t y es W i t hi n
Requi r ,
ry s each Al l o , record U ni qu sam e
ed im pact
Key record i n wed i dent i fi c e t abl e
ot her
a t abl e. at i on. I ndex
t abl es.
Dat a
Est abl i sh
consi st en More
es a M ay
Forei Not cy, Bet w ee fl exi bl
rel at i ons Al l o creat
gn Requi r rel at i ons n e f or
hi p wed e
Key ed hi p t abl es mai nt en
bet w een I ndex
mai nt enan ance.
t abl es.
ce.
Al t ernat i
ve uni que Backup M ay May
Candi Not W i t hi n
keys t hat Requi r pri m ary creat becom e
dat e Al l o sam e
coul d be ed key e pri mary
Key wed t abl e
pri m ary opt i ons. I ndex key.
keys.
C om bi nat i
on of M ay
C oncept ua C oncep
Super at t ri but e Requi r Al l o creat
l , not t ual N/A
Key s t hat ed wed e
enf orced. use
uni quel y I ndex
i dent i f y.
M ay be
Com bi ned C reat
Speci al i z com pl ex
Com po at t ri but e Not es W i t hi n
Requi r ed uni que ,
si t e s used as Al l o C om po sam e
ed i dent i fi c im pact
Key a si ngl e wed si t e t abl e
at i on. perf orm
key. I ndex
ance.
Onl y one pri m ary key i s Whereas more t han one f orei gn key i s
al l owed i n a t abl e. al l owed i n a t abl e.
I t i s a com bi nat i on of
I t can cont ai n dupl i cat e val ues and a
UNIQ UE and N ot N ul l
t abl e i n a rel at i onal dat abase.
const rai nt s.
I t s val ue cannot be
I t s val ue can be del et ed f romt he
del et ed f romt he parent
chi l d t abl e.
t abl e.