Vous êtes sur la page 1sur 94

9

juT Data

msTfs;> vOj;JUf;fs;> FwpaPLfs;


vd;gtw;iwf; nfhz;L fzpdpahy;
Nkw;nfhs;sg;gLk; nray;Kiwfs;> ,it
kpd; rkpQ;irfshf flj;jg;gl;L fhe;j
xspapay;> nghwpapay; Clfq;fspy;
Nrkpj;J itj;jyhFk;.
ts%yk;: Google- What is data?


The quantities, characters, or symbols on
which operations are performed by a
computer, which may be stored and
transmitted in the form of electrical signals
and recorded on magnetic, optical, or
mechanical recording media.
Source: Google- What is data?


Information is data that has been processed in
such a way as to be meaningful to the person
who receives it.
jfty;: Information
jfty; vd;gJ mjid
ngw;Wf;nfhs;gtWf;F tpsf;fj;ijf;
nfhLf;ff; $ba tifapy;
Kiwtopg;gLj;jYf;fl;gLj;jg; gl;l
juthFk;.


,
,

,
:



1.
2. ER
3. ER

4.
5.
6. DDL

7. DML

gpuNahf nray;Kiwfs;
1. Njitfisf; fz;lwpjy;
2. ER tiuglj;ij jahupj;jy;
3.ER tiuglj;ij njhlu;GKiw juTj;js
ml;ltizf;F khw;Wjy;
4. ,ay;ghf;fy;
5. xUikg;ghL fl;Lg;ghbly;
6.DDL cgNahfpj;J njhlu;GKiw
juTj;jsk; cUthf;fy;
7. DML cgNahfpj;J juT Kfhikj;Jtk;
nra;jy;




.
, , ,
, ,

.
.
.

.



.
.
.


6.

1.
2.
3.
4.
5.

7.

, ,
, , ,
...

Njitfis mwpe;J nfhs;sy;


ghlrhiy xd;wpYs;s khztu;fs; gy;NtW
tpisahl;Lf;fspy; <LgLtJld; xt;nthU
tpisahl;bw;Fk; nghWg;ghd xU MrpupaUk; xU ,lKk;
,Uf;Fk;. ,t;tpisahl;Lf;fspy; gq;F nfhs;Sk;
khztu;fsJ Nru;tpyf;fk;> khztu; ngau;> tPl;L
Kftup> tFg;G> gq;Fgw;Wk; tpisahl;L> tpisahl;Lj;
jiytd; Nghd;wit mlq;fpa Nfhg;nghd;iw
eilKiwg; gLj;Jtjw;F mjpgu; jpl;lkpl;Ls;shu;. xU
khztu; xd;Wf;F Nkw;gl;l tpisahl;Lf;fspy; <Lgl
KbAk;. Fwpg;gpl;l xU tpisahl;bw;F xd;Wf;F Nkw;gl;l
khztu;fs; ,Uf;fyhk;. xt;nthU khztDk;; Kd;dNu
xU tpisahl;bw;fhf xJf;fg;gl;l kzpj;jpahyq;fspd;
gb fye;J nfhs;sKbAk;.

ER
1.

2. ,

3. () ()

4. (),

5.

ER tiuglj;ij jahupj;jy;
,dq;fhzg;gl;l nghJg; ngau;r; nrhw;fisAk;> tpidr;
nrhw;fisAk; Ntwhf;fpf; nfhs;sy;.
nghJg; ngau;r; nrhw;fs;> cUnghUs;> gz;Gfs;
vd;gtw;iw Ntwhf;fpf; nfhs;sy;.
nghJg; ngau;fs;fisAk; (cUnghUs;fs;)>
tpidr;nrhw;fisAk; (njhlu;GKiw) njhlu;G gLj;jy;
nghJg; ngau;fis (gz;Gfs;)> cUnghUs;fSld;
mDtjpj;jy; (Secondment)
vz;zstpid mwpe;J nfhs;sy;

ER




1: M
1 M




ER tiuglj;ij njhlu;GKiw
juTj;js ml;ltizf;F khw;Wjy;
njhlu;G
Kiw
Xd;W xd;W

nray;Kiw
cUnghUs;fs; ,uz;il ml;ltizfs; ,uz;lhf
khw;WjYk;> xU cUnghUspd; Kjd;ikr; rhtpia
mLj;j cUnghUspy; me;epar; rhtpahf mikj;jYk;

Xd;W - gy cUnghUs;fs; ,uz;il ml;ltizfs; ,uz;lhf

khw;WjYk;> 1:M ,d; 1 w;Fupa gf;fj;jpYs;s


cUnghUspd; Kjd;ikr; rhtpia M gf;fj;jpYs;s
cUnghUspd; me;epar;rhtpahf ghtpj;jYk;
gy gy

cUnghUs;fs; ,uz;il ml;ltizfs; ,uz;lhf


khw;WjYk;> Gjpjhf ml;ltiznahd;iw cUthf;fp
mit ,uz;bdJk; Kjd;ikr; rhtpfisAk; ,izj;J
cUthf;fg;gl;l me;epar;rhtp Gjpa ml;ltizapy;
Kjd;ikr; rhtpahf gad;gLj;jy;

9.2njhlu;Gepiyj; juTj;jsk; vd;gij


tpgupg;ghu;.




juTj;jsk; xd;wpd; $Wfs;.
md;whl
tho;tpd;
NjitfSf;Fg;
gad;gLj;Jthu;.


njhlu;Gepiyj; juTj;jsk; (Relational Database)
, .

xd;Wld; xd;W njhlu;GilaJk;>


xOq;fikf;fg;gl;lJkhd
juTj;jsnkhd;wpd; njhFg;G vd vspjhf
tpsf;f KbAk;.
,jd; %d;W gFjpfis ,dq;fhz
KbAk;.

(Table) ml;ltiz
(Record/Row/Tuple) gjpT/tupir
(Field/ Attribute) Gyk;

njhlu;Gepiyj; juTj;jsk;
(Relational Database)

(DBMS)
(Relational Database)
.

,t;tpsf;fj;jpw;fika juTj;js
Kfhikj;Jt Kiwiknahd;iwg; (DBMS)
gad;gLj;jp ml;ltizfs; gytw;iw
cUthf;Ftjhy; khj;jpuk; mJ xU
juTj;js Kfhikj;Jt Kiwik
(Relational Database) nahd;whf
miktjpy;iy vd;gJ ftzpf;fg;gl
Ntz;ba tplakhFk;.


.
cUthf;fg;gl;l ml;ltizfSf;fpilapy;
njhlu;GKiw cUthf;ff; $bathW
ml;ltizfs; cUthf;fg;gl Ntz;Lk;.

juT
Kiwapdhy; fpilf;Fk; ed;ikfs
(redundancy)
.
juT kpifikiaf; Fiwj;Jf;nfhs;syhk;
(inconsistency)
.
xUq;fpirtpd;ikia jtpu;Jf; nfhs;sf;
$
; baik
(share) .
juitg; gfpu;e;J gad;gLj;jf;$baik

njhlu;r;rp
(standards) .
epakq;fis mKy;gLj;jf;$baik

(security)

ghJfhg;G tiuaiwfis gad;gLj;jf;$baik

(integrity)

juT xOq;fikitg; ghJfhj;jy;

(redundancy) kpifik

kpifikapd; fhuzkhf ,lf;nfhs;ssT
tPzhf;fg;gLfpd;wJ.

kpifikapid KOikahf ePf;fKbAk; vdNth

.
my;yJ KOikahf ePf;fg;gl Ntz;Lk; vd;gJ
fUj;jhFk;.

(inconsistency)
.
.
.

.



.
. .

.
.

.

cjhuzkhf


.
.
.
ml;ltiznahd;wpd; Kjd;ikr;rhtp NtnwhU
ml;ltizapy; me;epar;rhtpahf ghtpf;fg;gLkplj;J
xNu juT kPz;Lk; kPz;Lk; gjpT nra;ag;gLfpd;wJ.
,J jtpu;f;f KbahjjhFk;. ,q;F kpifik gw;wpa
rpf;fy; Njhd;Wfpd;wJ.

.
mt;thwhd kPs;gjpTfs; eilngwhtpbd; ml;ltiz
,uz;bw;fpilapyhd njhlu;GKiw Vw;glhJ.

(share)
juitg; gfpu;eJ
; gad;gLj;jf;$baik
""
/ .
juTj;jsnkhd;wpy; juT vd;gJ mq;F
Nrkpf;fg;gl;bUf;Fk; ngWkhdq;fs; MFk;.


" / "
.
mt;thW Nrkpf;fg;gl;bUf;Fk;
ngWkhdq;fs; %yk; gadu; xUtuhy;
tpsf;fnkhd;iw ngwKbAkhapd; mJ
jftyhFk;
.
gadu;fs; ,Utifg;gLtu;
(single user) jdpg;gadu;
(multi user) gw;g
; adu;

(single user) jdpg;gadu;


.
rhjhuzkhf xU fzpdpiag; ghtpg;ghu;

(applications) .
xU fzpdpAs; xd;Wf;F Nkw;gl;l
gpuNahfq;fs; (applications) %yk; xNu juT
gad;gLj;j KbAk;

(multi user) gw;;gadu;


.
rhjhuzkhf xd;Wf;F Nkw;wl;l fzpdp
ghtpf;fg;gLk;

(application)
Xd;Wf;F Nkw;gl;l fzpdpfs;
ghtpf;fg;gLtjd;%yk; gy gadu;fs; xNu
gpuNahfj;ij xNu rkaj;jpy; Nkw;nfhs;syhk;

.
,t;tpU re;ju;g;gq;fspd;NghJk; juT gfpu;T
eilngWfpd;wJ.


(application)
.
xNu jilitapy; cUthf;fg;gl;l
juitg;gad;gLj;jp Gjpa gpuNahfq;fis
cUthf;fyhk;

.
,r;re;ju;g;gj;jpy; gpuNahf nkd;nghUs;fs;
juit gfpu;e;J gad;gLj;Jfpd;wd.

(share).
juitg; gfpu;e;J gad;gLj;jy;

juTj;jsk;

gpuNahfk;;

gadu;

(standards) epakq;fs;
epakq;fs;
(application) gpuNahfq;fs;
(data representation) juT
gpujpepjpj;Jtk;
(data exchange)juT gupkhw;wk;
(data naming)juT ngauply;
(documentation) Mtzg;gLj;jy;

,
.

(security)

ghJfhg;G

mDfy; topfisf; fl;Lg;gLj;jy;


(retrieve,

modify, update,

delete, etc) .
gy;NtWgl;l gadu;fSf;F (retrieve, modify,
update, delete, etc)cupkkspj;jy;.
.

,yj;jpuzpay; juTj;jsnkhd;wpy;
fl;lhak; ,Uf;f Ntz;ba xU mk;rkhFk;

(integrity) juT xOq;fikT


.

kPsg
; jpT Vw;gLjypd; tpiythy;
cz;lhtjhFk;
.

rupepiy cWjpg;gLj;jy; ,jd;%yk;


eilngWk;

.
kPs;gjpT ,y;yhtpbDk; rupepiy
cWjpg;gLj;jy; Ntz;Lk;.

njhlu;Gepiyj; juTj;jsk;

.

,U tplaq;fs;
G+u;j;jpahf;fg;gl Ntz;Lk;.

.
rfy juTfSk; ml;ltizfspy; khj;jpuk; Nrkpj;jy;
(operations)
.
rfy nraw;ghLfs; (operations) %yKk; gioa ml;ltizfs;
ghtpf;fg;gl;L Gjpa ml;ltizfs; cUthFjy;.
SQL .
vdNt> SQL fl;lisfs; %yk; fpilf;Fk; midj;J ngWNgWfSk;
ml;ltizfshFk;.

Gyq;fs;
.

njhlu;Gepiyj; juTj;jsnkhd;wpy; juTfs;


gjpag; gLtJ Gyq;fspyhFk;.
.

Gynkhd;wpDy; xNutifahd juTfs;


gjpag;gLk;.

.
njhlu;Gepiyj; juTj;jsnkhd;wpy; Gynkhd;W NkYk;
gpupglhJ

.

mjhtJ NkYk; rpW gFjpfshf


NtWgLj;Jtjw;J juTj;jsj;jpw;F KbahJ.


(date ) , ,
. ,
.
.

cjhuzk;:
jpfjp(date) Gynkhd;nwdpd; mjid tUlk;>
khjk;> jpfjp vd njhlu;Gepiyj;
juTj;jsnkhd;wpw;F KbahJ. mt;thW
Njitnadpd; nkdnghUspDs; nra;ag;gl
Ntz;Lk;.
mJ jpfjpjhd; vd mwpa njhlu;Gepiyj;
juTj;jsnkhd;wpw;F KbahJ.

Gyq;fs;

student table

index name

address

class

1022

S.M.G.D. Dayasiri

No.15, Peradeniya Road, Kandy

8B

566

G.M.D. Priyangani

N0.147/7, Katugasthota Road, Kandy

11 C

923

F.D.C. Jayasingha

Sadasiri, Colombo Road, Mawanella

10 B

Gyq;fs;

gjpT
student table

index name

address

class

1022

S.M.G.D. Dayasiri

No.15, Peradeniya Road, Kandy

8B

566

G.M.D. Priyangani

N0.147/7, Katugasthota Road, Kandy

11 C

923

F.D.C. Jayasingha

Sadasiri, Colombo Road, Mawanella

10 B

gjpT
(records)
.

gjpT xd;W Gyk; xd;wpdhNyh gytw;whNyh ,Uf;fyhk;

ml;ltiz
student table

index name

address

class

1022

S.M.G.D. Dayasiri

No.15, Peradeniya Road, Kandy

8B

566

G.M.D. Priyangani

N0.147/7, Katugasthota Road, Kandy

11 C

923

F.D.C. Jayasingha

Sadasiri, Colombo Road, Mawanella

10 B


ml;ltiznahd;wpy; gjpTfs;
. G+r;rpakhf

,Uf;fyhk;
. Xd;whf ,Uf;fyhk;
. Xd;wpw;F
; Nkw;gl;ljhf
,Uf;fyhk;

ml;ltiznahd;wpd; ,ay;Gfs;
index name

address

class

1022

S.M.G.D. Dayasiri

No.15, Peradeniya Road, Kandy

8B

566

G.M.D. Priyangani

N0.147/7, Katugasthota Road, Kandy

11 C

923

F.D.C. Jayasingha

Sadasiri, Colombo Road, Mawanella

10 B

epiy(Degree)
# of fields

Vz;zsit(Cardinality)
# of records

student table

ml;ltiznahd;wpd; ,ay;Gfs;
.
gjpTfspd; gpujpfs; ,Uf;f KbahJ
(unordered).

gjpTfs; tupir Kiwapy; fhzg;glhJ


.

Gyq;fs; tupir Kiwapy; fhzg;glhJ


(atomic).
Gyq;fspy; Nrkpf;fg;gl;l ngUkhdq;fs;
gpupgl KbahJ.

njhlu;Gepiyfs;

- xd;W

xd;W (1:1)
- xd;W - gy (1:m)
- gy - gy (m:n)

xd;W - xd;W (1:1) njhlu;Gepiy


student

1
table

xU khztUf;F xU Nkir xJf;fg;gl;Ls;sJ


.

xU Nkir xU khztUf;F xJf;fg;gl;Ls;sJ

xd;W - xd;W (1:1) njhlu;Gepiy


1
student

table

xU khztUf;F xU Nkir xJf;fg;gl;Ls;sJ

xd;W - xd;W (1:1) njhlu;Gepiy


1
student

table

xU Nkir xU khztUf;F xJf;fg;gl;Ls;sJ

-
xd;W - xd;W (1:1) njhlu;Gepiyia fl;bnaOg;gy;
student (Pkey index)

Table (Pkey tableId)

index

name

address

S001

Athula

Badulla

S002

Saman

Kandy

tableId

title

T001

Table 1

T002

Table 2

njhlu;nghd;W ,y;iy
?

njhlu;nghd;W cUthf;FtJ vt;thW?

xd;W - xd;W (1:1) njhlu;Gepiyia fl;bnaOg;gy;


1

tpdty; xd;W1
table (Pkey tableId)

student (Pkey index)


index

tableId

name

address

S001

T002

Athula Badulla

S002

T001

Saman Kandy

tableId

title

T001

Table 1

T002

Table 2

tpdty; 2
student (Pkey index)

table (Pkey tableId)

index

name

address

tableId

index

title

S001

Athula

Badulla

T001

S001

Table 1

S002

Saman

Kandy

T002

S002

Table 2

1 2

njhlu;Gepiyia fl;bnaOg;gy

Xd;W - xd;W

xU cUnghUspd; Kjd;ikr; rhtpia


mLj;j cUnghUspy; me;epar; rhtpahf
mikj;jYk;

xd;W - gy njhlu;Gepiyia
m

student

class


.
.

ghlrhiy Kiwiknahd;wpy;
xU khztUf;F tFg;gpy; khj;jpuk; ,Uf;fyhk;
xU tFg;gpy; khztu; xUtu; my;yJ gyu;
,Uf;fyhk;.

xd;W - gy njhlu;Gepiyia
student

class

.
.
.
.

xU tFg;gpy; khztu; xUtu; khj;jpuk;;


,Uf;fyhk;.
xU khztUf;F xd;wpw;F Nkw;gl;l tFg;Gfspy;
,Uf;fyhk;
ghlrhiy Kiwiknahd;iwf; fUJk; NghJ
,J rupahdjy;y.
vdpDk; jdpahu; tFg;G Kiwikfspy;
,t;thwhd re;ju;g;gq;fs; ,Uf;fyhk;.

xd;W - gy njhlu;Gepiyia fl;bnaOg;gy;


jPu;T1 (%d;whk; ,ay;ghf;fy; ml;ltiz ,uz;L)
student (Pkey index)

index

classId

name

class (Pkey classId)

address

S001

C012

Athula Badulla

S002

C012

Saman Kandy

student (Pkey index)

classId

title

C012

Grade 12

C013

Grade 13

class (Pkey classId)

index

name

address

classId

index

title

S001

Athula

Badulla

C012

S001

Grade 12

S002

Saman

Kandy

C012

S002

Grade 12

C013

Grade 13

,J xU jPu;thf mikahjJ Vd; vd fye;JiuahlTk;

xd;W - gy njhlu;Gepiyia fl;bnaOg;gy;


jPu;T1 (%d;whk; ,ay;ghf;fy; ml;ltiz %d;W)

class (Pkey classId)

student (Pkey index)


index

name

address

S001

Athula Badulla

S002

Saman Kandy

classId

title

C012

Grade 12

C013

Grade 13

class (Pkey classId + Index)


classId

index

C012

S001

C012

S002


njhlu;Gepiyia fl;bnaOg;gy;
njhlu;Gepiy

nray;Kiw

-
Xd;W-xd;W


xU cUnghUspd; Kjd;ikr; rhtpia mLj;j cUnghUspy;
me;epar; rhtpahf mikj;jy;

1: M 1 M

Xd;W-gy

1:M ,d; 1 w;Fupa gf;fj;jpYs;s

cUnghUspd; Kjd;ikr; rhtpia M


gf;fj;jpYs;s cUnghUspd;
me;epar;rhtpahf ghtpj;jy;
-

gy- gy njhlu;Gepiy
m

student

ghlrhiy

sport

Kiwiknahd;wpy;

xU khztUf;F xd;wpw;F Nkw;gl;l tpisahl;Lfspy; gq;F


nfhs;syhk;
.

xW tpisahl;bw;F gy khztu;fs; gq;F nfhs;syhk;

njhlu;Gepiyia fl;bnaOg;gy;

sport (Pkey sportId)

student (Pkey index)


index

sportId

name

address

S001

SP001

Athula

Badulla

S001

SP002

Athula

Badulla

sportd

name

SP001

Badminton

SP002

Cricket

,J
xU(Pkey
jPu;t
hf mikahjJ Vd; vd sport
fye;
JiuahlTk;
student
index)
(Pkey
sportId)
index

name

address

sportId

index

title

S001

Athula

Badulla

SP001

S001

Badminton

S002

Saman

Kandy

SP001

S002

Badminton

,J xU jPu;thf mikahjJ Vd; vd fye;JiuahlTk;

njhlu;Gepiyia fl;bnaOg;gy;
sport (Pkey sportId)

student (Pkey index)


Index

name

address

S001

Athula

Badulla

S002

Saman

Kandy

studentSport(Pkey index+sportId)

sportId

name

SP001

Badminton

SP002

Cricket

index

sportId

S001

SP001

S002

SP001

S001

SP002

S002

SP002

Gjpjhf ml;ltiznahd;W cUthf;f Ntz;Lk;;

Xd;W - xd;W
-

Xd;W - gy

gy - gy


xU cUnghUspd; Kjd;ikr; rhtpia mLj;j cUnghUspy;
me;epar; rhtpahf mikj;jy;

1: M 1 M

1:M ,d; 1 w;Fupa gf;fj;jpYs;s cUnghUspd; Kjd;ikr;
rhtpia :M gf;fj;jpYs;s cUnghUspd; me;epar;rhtpahf
ghtpj;jy;


Gjpjhf ml;ltiznahd;iw cUthf;fp mit ,uz;bdJk;
Kjd;ikr; rhtpfisAk; ,izj;J cUthf;fg;gl;l me;epar;rhtp
Gjpa ml;ltizapy; Kjd;ikr; rhtpahf gad;gLj;jy;

,ay;ghf;Fjy;

Kjy; ,ay;G

(Fields)

xNu khjpupahd Gyq;fs; (Fields) kPz;Lk;


kPz;Lk; cNahfg;gLj;jy; jtpu;f;fg;gly;.

,uz;lhk; ,ay;G

juT (Data) kPz;Lk; kPz;Lk; cNahfg;gLj;jy;


jtpu;f;fg;gly;.

%d;wlhk; ,ay;G

ml;ltiznahd;wpy; ,Uf;Fk; gjpTfs;


Kjd;ikr;rhtpapy; khj;jpuk; jq;fpapUg;gij cWjp
nra;jy;

First Normal Form Kjy;

,ay;G tbtk;

Eliminate repeating groups in individual tables.


Create a separate table for each set of related data.
Identify each set of related data with a primary key.

xNu khjpupahd Gyq;fs; (Fields) kPz;Lk;


kPz;Lk; cNahfg;gLj;jy; jtpu;f;fg;gly;.
Xd;Nwhnlhd;W njhlu;Gila Gyq;fisf;
nfhz;L jdpnahU ml;ltiz
cUthf;Fjy;.
Xd;Nwhnlhd;W njhlu;Gila Gyq;fis
Kjd;ikr;rhtp %yk; milahsk; fhz
KbAk; vd;gij cWjpr;nra;jy

First Normal Form Kjy; ,ay;G tbtk;


Do not use multiple fields in a single table to store similar data.

xNu tifahd juTfis gjptjw;F gy


Gyq;fis ghtpj;jy; $lhJ.
For example, to track an inventory item that may come from two possible
sources, an inventory record may contain fields for Vendor Code 1 and
Vendor Code 2.

cjhuzkhf> ,U tsq;fspypUe;J nghUl;gjpNtl;bw;F


tuf; $ba tplankhd;iw NjLk; NghJ Vendor Code 1,
Vendor Code 2. vDk; Gyq;fs; fhzg;glyhk;.
%d;whtJ Nru;ff
; Ntz;b Vw;gbd; vd;d elf;Fk;.
NkYk; xU Gyj;ij Nru;g;gJ jPut
; y;y. ,jw;F
epuyplYk; ml;ltizfis GJg;gpj;jYk;
mtrpakhtJld;> Vendor u;fs; khWk; vz;zpf;iff;F
,lkspf;f KbahJ.

vdNt> rfy tpahghupfisAk;


cs;slf;ff;$ba tifapy; vendor
vDk; jdpahd ml;ltiznahd;wpy;
mj;jfty;fis gjpa Ntz;Lk;. gpwF
mjid nghUs; gjpNtl;Lld;
Kjd;ikr;;rhtpg; Gynkhd;Wld; njhlu;G
gLj;jTk;. cjhuzk;
item number key, vendor code key.

First Normal Form


What happens when you add a third vendor?
Adding a field is not the answer; it requires
program and table modifications and does not
smoothly accommodate a dynamic number of
vendors. Instead, place all vendor information
in a separate table called Vendors, then link
inventory to vendors with an item number
key, or vendors to inventory with a vendor
code key.


Kjy; ,ay;ghf;fy;

Student kPz;Lk; kPz;Lk; ghtpf;fg;gl;Ls;s


Gyq;fs;
STIndex

SName

Desk

DName Coach1

Name1

Coach2

Name2

710

Saman

D001

Desk1

515

Nimal

D002

712

Sudath

D003

T125

Anil

T127

Sunil

T130

Wimal

Desk2

T127

Sunil

T125

Anil

T130

Wimal

Desk3

T130

Wimal

T125

Anil

T127

Sunil

:
ER

Fwpg;G:
ER tiuglk; rupahf cUthf;fg;gl;lhy; ,e;epiy
fhzg;glhJ

Coach3 Name3

Kjy; ,ay;ghf;fy;
StudentCoach (1st Normal form)
SName

Desk

DName

Coach

Name

710

Saman

D001

Desk1

T125

Anil

710

Saman

D001

Desk1

T127

Sunil

710

Saman

D001

Desk1

T130

Wimal

515

Nimal

D002

Desk2

T127

Sunil

515

Nimal

D002

Desk2

T125

Anil

515

Nimal

D002

Desk2

T130

Wimal

712

Sudath

D003

Desk3

T130

Wimal

712

Sudath

D003

Desk3

T125

Anil

712

Sudath

D003

Desk3

T127

Sunil

STIndex

Second Normal Form


,uz;lhk; ,ay;ghf;fy;
Eliminate fields that do not depend on the
key.
rhtpapy; jq;fpapuhj Gyq;fs;
ePf;fg;gLfpd;wd.

Second Normal Form


Records should not depend on anything other than a
table's primary key (a compound key, if necessary).
For example, consider a customer's address in an
accounting system. The address is needed by the
Customers table, but also by the Orders, Shipping,
Invoices, Accounts Receivable, and Collections tables.
Instead of storing the customer's address as a
separate entry in each of these tables, store it in one
place, either in the Customers table or in a separate
Addresses table.

,uz;lhk; ,ay;ghf;fy;
gjpTfs; ml;ltizap;d; Kjd;ikr;rhtpapyd;wp
NtW tplaq;fspy; jq;fpapUf;ff;$lhJ .(
Njitg;gbd; fyg;Gr;rhtp)
cjhuzj;jpw;F fzf;fPl;L Kiwiknahd;wpy;
thbf;ifahsupd; Kftupiaf; fUj;jpw;nfhs;f.
customer ml;ltiznahd;wpw;F Kftup
mtrpakhtJ Nghy; Orders, Shipping, Invoices,
Accounts Receivable, Collections Mfpatw;wpw;Fk;
Njitg;gLfpd;wJ.

,uz;lhk; ,ay;ghf;fy;
thbf;ifahsupd; (customer) Kftupia
xt;nthU ml;ltizapYk;; jdpj;jdpahf
gjpT nra;tjw;Fg; gjpyhf customer
ml;ltizapy; my;yJ address
ml;ltizapy; jdpahf gjpayhk;

,uz;lhk; ,ay;ghf;fy;

StudentCoach (1st Normal form)

Coach (3rd Normal form)

SName

Desk

DName

Coach

Coach

Name

710

Saman

D001

Desk1

T125

T125

Anil

710

Saman

D001

Desk1

T127

T127

Sunil

710

Saman

D001

Desk1

T130

T130

Wimal

515

Nimal

D002

Desk2

T127

515

Nimal

D002

Desk2

T125

515

Nimal

D002

Desk2

T130

712

Sudath

D003

Desk3

T130

712

Sudath

D003

Desk3

T125

712

Sudath

D003

Desk3

T127

STIndex

,uz;lhk; ,ay;ghf;fy;

StudentCoach (3rd Normal form)

Student (2nd Normal form)

STIndex

Coach

STIndex

710

T125

710

SName

Desk

DName

710

Saman

D001

Desk1

T127

515

Nimal

D002

Desk2

710

T130

712

Sudath

D003

Desk3

515

T127

515

T125

515

T130

712

T130

712

T125

712

T127

Coach (3rd Normal form)


Coach

Name

T125

Anil

T127

Sunil

T130

Wimal

Third Normal Form


Values in a record that are not part of that
record's key do not belong in the table. In
general, any time the contents of a group of
fields may apply to more than a single record
in the table, consider placing those fields in a
separate table.

%d;whk;; ,ay;ghf;fy;
cjhuzj;jpw;F Ckpau; Ml;Nru;gG (Employee
Recruitment )ml;ltizapy;> xU Nju;T ehLdu;
(candidate)gy;fiyf;fofg; ngau; kw;Wk; Kftup
cs;slf;fg;gl;bUf;ff;$Lk;. Mdhy; FO mQ;ry;
Kiwapy; jfty; mDg;g> rfy
gy;fiyf;fyfq;fspd; ngau;g;gl;bay; Njitg;gLk;.
gy;fiyf;fyfq;fspd; tpguq;fs; candidate
ml;ltizapy; Nrkpf;fg;gl;bUg;gpd;
Nju;T ehLdu;fs; ,y;yhj gy;fiyf;foq;fis
gl;bay;gLj;j Kbahj epiyNaw;gLk;. MfNt
gy;fiyf;fofj;jpw;nfd gpwpnjhU ml;ltizia
cUthf;fp mjid candidate ml;ltizAld;
rhtpg;Gynkhd;Wld; njhlu;G gLj;jTk;. (university
code key

Third Normal Form


For example, in an Employee Recruitment
table, a candidate's university name and
address may be included. But you need a
complete list of universities for group
mailings. If university information is stored in
the Candidates table, there is no way to list
universities with no current candidates. Create
a separate Universities table and link it to the
Candidates table with a university code key.

%d;whk;; ,ay;ghf;fy;
StudentCoach (3rd Normal form)
STIndex

Coach

710

T125

710

T127

710
515

Student (2nd Normal form)

SName

Desk

DName

710

Saman

D001

Desk1

515

Nimal

D002

Desk2

712

Sudath

D003

Desk3

STIndex

T130
T127

515

T125

515

T130

712

T130

712

T125

712

T127

Coach (3rd Normal form)


Coach

Name

T125

Anil

T127

Sunil

T130

Wimal


StudentCoach (3rd Normal form)
STIndex

Coach
T125

710

T127

710

T130

515

T127

515

T125

515

T130

712
712

SName

Desk

710

Saman

D001

515

Nimal

D002

712

Sudath

D003

STIndex

710

712

Student (3rd Normal form)

Coach

(3rd

Normal form)

Coach

Name

T125

Anil

T127

Sunil

T130
T125
T127

T130

Wimal

Desk (3rd Normal form)


Desk

DName

D001

Desk1

D002

Desk2

D003

Desk3

Types of constraints
fl;Lj;jpl;l tiffs;
A NOT NULL constrain

ntw;W kWg;Gf; fl;Lg;ghL


A unique constraint

jdpj;Jt fl;Lg;ghL
A primary key constraint

Kjd;ikr;rhtpf; fl;Lg;ghL

A foreign key constraint

me;epar;rhtpf; fl;Lg;ghL
A (table) check constraint

ml;ltiz rupghu;jj
; y; fl;Lg;ghL

A NOT NULL constraint


A NOT NULL constraint is a rule that prevents
null values from being entered into one or
more columns within a table
ntw;W kWg;Gf; fl;Lg;ghL vd;gJ
ml;ltiznahd;wpd; epunyhd;wpy;
my;yJ gytw;wpy; ntw;W ngWkhdq;fs;
gjpT nra;ag;gLtij jilnra;fpwJ.

A unique constraint
A unique constraint (also referred to as a
unique key constraint) is a rule that forbids
duplicate values in one or more columns
within a table. Unique and primary keys are
the supported unique constraints. For
example, a unique constraint can be defined
on the supplier identifier in the supplier table
to ensure that the same supplier identifier is
not given to two suppliers.

jdpj;Jt fl;Lg;ghL
jdpj;Jt fl;Lg;ghL vd;gJ xU
ml;ltiznahd;wpd; xU my;yJ gy
Gyq;fspy; xNu juT ,d;ndhUKiw gjpT
nra;ag;gLjiy jLf;fpd;wJ. jdpj;Jt kw;Wk;
Kjd;ikr;rhtp Mfpad jdpj;Jt
fl;Lg;ghLfSf;F cjTfpd;wd.
cjhuzj;jpw;F> supplier ml;ltizapy; toq;Fdu;
xUtiu jdpj;Jtkhf ,dq;fhz;gjw;F xt;nthU
toq;FdUf;Fk; milahsq;fhzp
(identifier)toq;fg;gLfpd;wJ. ,jd;%yk; xNu
milahsq;fhzp ,d;DnkhU toq;FdUf;F
toq;fg;glhkypUg;gij jdpj;Jt fl;Lg;ghL cWjp
nra;fpwJ.

A primary key constraint

Kjd;ikr;rhtpf; fl;Lg;ghL
A primary key constraint is a column or combination of
columns that has the same properties as a unique constraint.
You can use a primary key and foreign key constraints to
define relationships between tables.
Kjd;ikr;rhtpf; fl;Lg;ghL vd;gJ jdpj;Jt
fl;Lg
; ;ghl;by; cs;sJ Nghd;w gz;Gfisf; nfhz;l xU
my;yJ gy Gyq;fspd; Nru;fi
; fahFk;.
ml;ltizfSf;fpilapyhd njhlu;ig tiuaWf;f>
Kjd;ikr;rhtpf; fl;Lg;ghl;ilAk; me;epar;rhtpf;
fl;Lg;ghl;ilAk; ghtpf;fyhk;.

A foreign key constraint


me;epar;rhtpf; fl;Lg;ghL
A foreign key constraint (also referred to as a
referential constraint or a referential integrity
constraint) is a logical rule about values in one
or more columns in one or more tables.
me;epar;rhtpf; fl;Lg;ghL vd;gJ xU
my;yJ gy ml;ltizfspy; cs;s xU
my;yJ gy Gyq;fspd; ngWkhdk; gw;wpa
ju;f;f tpjpahFk;

A foreign key constraint


For example, a set of tables shares
information about a corporation's suppliers.
Occasionally, a supplier's name changes. You
can define a referential constraint stating that
the ID of the supplier in a table must match a
supplier ID in the supplier information. This
constraint prevents insert, update, or delete
operations that would otherwise result in
missing supplier information.

A foreign key constraint


me;epar;rhtpf; fl;Lg;ghL
cjhuzj;jpw;F xU $l;Lj;jhdj;jpd;
toq;Fdu;fsJ jfty;fis xU njhFjp
ml;ltizfs; gupkhwpf;nfhs;fpd;wd. toq;Fdu;
xUtupd;; ngau; mbf;fb khWgLfpd;wJ. ,jw;F
Nkw;Nfhs; fl;Lj;jpl;nkhd;iw tiuaiw
nra;ayhk;. xU ml;ltizapypUf;Fk;
toq;Fdupd; ID toq;Fdu; tpguq;fs; mlq;fpa
ml;ltizapy; ID Ald; nghUe;jf;$bajf
,Uf;fNtz;Lk;. ,f;fl;Lg;ghL insert, update, or
delete Nghd;w nray;fis fl;Lg;gLj;Jfpd;wJ.

A (table) check constraint


A (table) check constraint (also called a check
constraint) sets restrictions on data added to a
specific table. For example, a table check
constraint can ensure that the salary level for
an employee is at least $20 000 whenever
salary data is added or updated in a table
containing personnel information.

(ml;ltiz) rupghu;j;jy; fl;Lg;ghL


(ml;ltiz) rupghu;j;jy; fl;Lg;ghL xU Fwpj;j
ml;ltizapy; Nru;f;fg;gLk; juTfSf;F
fl;Lg;ghLfis tpjpf;fpd;wJ.
cjhuzj;jpw;F (ml;ltiz) rupghu;j;jy;
fl;Lg;ghL> gpuj;jpNaf jfty; mlq;fpa
ml;ltizf;F rk;gs juTfs; Nru;f;fg;gLk;
NghJ my;yJ ,w;iwg;gLj;Jk; NghJ xU
njhopyhspf;Fupa rk;gsk; kl;lk; Mff;
Fiwe;jJ $20 000 fshf cs;snjd;gij cWjp
nra;fpd;wJ.

PARTICIPATION CONSTRAINT

gq;Nfw;G fl;Lg;ghL
An employee MUST work for a department
xU njhopyhsp jpizf;fsnkhd;wpw;fhf Ntiynra;a
Ntz;Lk;.
An employee entity can exist only if it participates in a WORKS_FOR
relationship instance

xU njhopyhsp vd;w cUnghUs; njhopy;Gupfpd;whu;


vDk; njhlu;G epiyAld; gq;Nfw;Fk; NghJ khj;jpuNk
,Uf;f KbAk;
Thus its participation is TOTAL

me;j tifapy; mjdJ gq;Nfw;G KOikahdJ


Only some employees manage departments
The participation is PARTIAL

rpy njhopyhsp khj;jpuk; jpizf;fsq;fis


Kfhikj;Jtk; nrafpd;wdu;. ,J rhu;Gila
gq;Nfw;ghFk;

Derived Attribute
Derived Attributes
Another one

Types of Databases
Flat-file.
Flat file databases most closely resemble paper files and
file cabinets. Flat file databases, while simple to create and
access, contain lots of redundant information. These
redundancies slow down the search process, making the
flat-file type of database inefficient.

,j;juTj; jsq;fs; fhfpjf; Nfhg;GfisAk;


Nfhg;Gg; ngl;bfisAk; xj;jdthf cs;sd.
,t;tifj; juTj;jsq;fis cUthf;fTk;
mDfTk; vspjhf ,Ug;gpDk; juT kpifik
mjpfstpy; fhzg;gLfpwJ.

Hierarchical.
Hierarchical databases relate tables in a
parent/child format. Although this reduces
redundancy and increases organization, it is still a
limiting way to handle data. The fact that child
tables at the same level don't have links to each
other makes searching problematic.

Relational.
Relational databases link tables with common
"key" fields allowing for sophisticated
relationships between tables. Table links can be
"indexed" or stored for future use, resulting in
quicker searches in this type of database.

Object-oriented.
Object oriented databases are structurally similar
to relational databases. While most other types of
databases are designed to hold text and numbers,
object-oriented databases are designed to store
audio, video and other mixed media objects.

Network

Vous aimerez peut-être aussi