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

IT-IM (1)

The document provides an overview of databases, emphasizing their structured organization for efficient data storage, retrieval, and management. It discusses key concepts such as tables, rows, columns, data types, primary keys, relationships, normalization, constraints, and SQL for querying data. The importance of data integrity and various SQL operations for manipulating and retrieving data are also highlighted.

Uploaded by

goodbyeacc7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

IT-IM (1)

The document provides an overview of databases, emphasizing their structured organization for efficient data storage, retrieval, and management. It discusses key concepts such as tables, rows, columns, data types, primary keys, relationships, normalization, constraints, and SQL for querying data. The importance of data integrity and various SQL operations for manipulating and retrieving data are also highlighted.

Uploaded by

goodbyeacc7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

JUNRELA.

SARUEDA

I
TINSTRUCTOR

CEBUEASTERNCOLLEGE

CEBUCI
TY6000

I
TIM FUNDAMENTALOFDATABASESYSTEM

Dat
abasesandi
mpor
tance

Adat abaseisastruct
uredcollecti
onofdataorganizedi
nawayt hatall
owsf oref
fi
cientst
orage,
ret
rieval
,andmani pul
ati
on.Itservesasacent r
alr
epositor
yf orinfor
mat i
on,provi
dinga
systemat i
candorganizedapproacht omanagingdata.Databasesar ecruci
al i
nvarious
applicat
ionsandindustri
esduet otheirabi
l
ityt
ostoreandr etr
ieveinfor
mationinar eli
abl
eand
eff
icientmanner.

Her
eisanov
erv
iewofdat
abasesandt
hei
rimpor
tance:

o St
ruct
uredDat
aSt
orage

Structureddat astoragereferstotheorgani
zedandsy stematicarr
angementofdat awithina
database.I nt hiscontext,"
struct
ured"impli
est hatt
hedat afoll
owsapr edefinedandconsi stent
format ,t
y picall
yorganizedintotableswithrowsandcol umns.Thest r
uct urehelpsineffici
ently
storing,managi ng,andretri
evingdata.St
ructureddataist y
pical
lystoredi ntabularform and
managedi nar elat
ionaldatabase(RDBMS) .Fieldscontaindataofapr edef i
nedf ormat.Some
fi
eldsmi ghthav east ri
ctformat,suchasphonenumber soraddresses, whileotherfiel
dscan
hav ev ar
iable-lengthtextstri
ngs,suchasnamesordescr i
pti
ons.

o 1Tabl
es:

Thefundamental
structur
ei narel
ati
onal dat
abasei
sthetabl
e.Eachtableconsi
stsofr
owsand
col
umns, wher
eeachr owr epr
esentsar ecor
dandeachcolumnrepresentsaspeci
fi
cattr
ibut
e
orf
iel
doft her
ecord.Tablesaredesignedbasedontherel
ati
onshi
psbet weenenti
ti
es.

o RowsandRecor
ds:

Rows,alsoknownasr ecor
dsortupl
es,representi
ndi
vidualentr
ieswi
thi
natabl
e.Eachr
ow
cont
ainsdatacorr
espondingt
oauni queinstanceorenti
ty.Forexampl
e,i
na"Customer
s"t
abl
e,
eachrowmi ghtr
epresentadi
ff
erentcustomer .

o Col
umnsandFi
elds:

Columns, al
soknownasfieldsorattr
ibutes,representspeci
fi
cpr
oper
tiesorchar
acteri
sti
csof
thedata.Eachcolumnhasadef ineddatat y
pe( e.g.
,text
,number
,dat
e)andholdsvalues
correspondi
ngtoapart
icularaspectofther ecords.

o Dat
aTy
pes:

Str
uctureddat
abasesdef
inespeci
ficdat
atypesf
oreachcolumnt oensur
edataconsi
stency
andintegr
it
y.Commondat at
ypesincl
udeint
eger
s,f
loat
ing-
pointnumbers,st
ri
ngs,
dates,and
more.

Pr
imar
yKey
s:

Aprimarykeyisauniqueident
if
ierf
oreachrecordinatabl
e.I
tensuresthateachrowcanbe
uni
quelyident
if
iedandisusedtoestabl
ishr
elati
onshi
psbetweentables.Thepri
marykeyi
s
oft
enacol umnwithauniqueconstr
aint
.

o Rel
ati
onshi
ps:
Structur
eddatabasesal
lowthecreat
ionofrelat
ionshi
psbet weentabl
es.Forexampl
e,a
"Customers"tabl
emighthav
ear elat
ionshi
pwi t
han" Order
s"tablebasedonthecust
omer'
s
pri
mar ykey,l
i
nkingcust
omerinformationwit
hcor r
espondingorders.

o Nor
mal
i
zat
ion:

Normali
zat
ionistheprocessoforgani
zi
ngdat
atominimi
zeredundancyanddependency.Thi
s
i
nvolv
esbreaki
ngdownl argetabl
esint
osmall
er,
rel
atedt
abl
estoreducedatadupli
cati
onand
i
mprovedataintegr
it
y.

o Const
rai
nts:

Const
rai
ntsarerul
esappl
iedtocolumnsort abl
estomai nt
aindat
ai nt
egr
it
y.Common
const
rai
ntsi
ncludeuni
queconstr
aints,checkconst
rai
nts,andfor
eignkeyconst
rai
nts,
whi
ch
ensur
ethatdataadher
estospeci
fi
edr ules.

o I
ndexi
ng:

Indexesarecreat
edonspeci
ficcol
umnst oenhancedat
aret
ri
evalspeed.Theyactli
keat abl
eof
contents,
all
owingthedat
abasesystem t
olocat
edatamorequickl
ybasedont heindexed
columns.

o Quer
yLanguage(
e.g.
,SQL)
:

Struct
uredQuer
yLanguage(SQL)i
susedtoint
eractwit
hstruct
ureddat
abases.SQLprovi
desa
standardi
zedwaytodef
ine,
manipul
ate,
andquerydata,al
l
owinguserst
operform oper
ati
ons
suchasSELECT, I
NSERT,UPDATE,andDELETE.

o Dat
aRet
ri
eval
andQuer
ying

Dataretri
evalandquer yi
ngarefundamentalaspectsofworki
ngwithdatabases,
all
owingusers
toextractspeci
fici
nformationfrom t
hestor
eddat a.Ret
ri
evali
nvolv
esobtaini
ngdatafrom a
database,whil
equer y
inginvolv
esusingaquer yl
anguagetointer
actwit
ht hedat
abaseand
ret
riev
er el
evantinf
ormat i
on.TheStruct
uredQueryLanguage(SQL)isthemostcommon
l
anguageusedf ordatabasequeryi
ng.

o SQLBasi
cs:

SQLi sadomain-speci
ficl
anguagedesignedf ormanagi
ngandqueryi
ngr el
ati
onaldat
abases.I
t
i
ncludescommandsf orcr
eating,updat
ing,andret
ri
evi
ngdataf
rom databases.CommonSQL
operationsi
ncl
udeSELECT( retri
evedata),
INSERT(addnewdata)
,UPDATE( modif
yexist
ing
data),andDELETE(removedat a).

o SELECTSt
atement
:

TheSELECTstatementi
sthepri
marySQLcommandforret
ri
evi
ngdatafr
om oneormoret
ables.
Ital
l
owsuserstospeci
fythecol
umnstheywantt
oret
ri
eve,
thetabl
efr
om whicht
oret
ri
evedata,
andopti
onal
conditi
onstofi
lt
ert
heresul
ts.

o Fi
l
ter
ingDat
awi
thWHERECl
ause:

TheWHEREcl ausei
susedtofi
l
terther
esul
tsbasedonspeci
fi
edcondi
ti
ons.Forexampl
e,t
o
ret
ri
evecust
omer swi
thaspeci
fi
cID:
o Sor
ti
ngDat
awi
thORDERBY:

TheORDERBYclauseisusedtosor
tther
etr
ieveddat
abasedononeormor
ecol
umns,
eit
heri
n
ascendi
ng(
ASC)ordescendi
ng(DESC)or
der.

o Joi
ningTabl
es:

Whendat
aisspreadacr
ossmul
ti
plet
ables,
JOINoper
ati
onsareusedt
ocombi
nerel
ated
i
nfor
mati
on.Commont y
pesofj
oinsi
ncl
udeINNERJOIN,LEFTJOI
N,andRI
GHTJOIN.

o Aggr
egat
ionFunct
ions:

SQLprovi
desaggr
egatefunct
ionsl
i
keSUM,
AVG,
COUNT,
MIN,
andMAXt
oper
for
m
cal
cul
ati
onsongroupsofrows.

o Subquer
ies:

Subquer
iesar
equer
iesembeddedwi
thi
not
herquer
ies.Theycanbeusedt
oret
ri
evev
aluesf
or
compari
sonorfi
l
ter
ing.

SELECTpr
oduct
_name

FROM pr
oduct
s

WHEREcategor
y_i
dIN(
SELECTcat
egor
y_i
dFROM cat
egor
iesWHEREcat
egor
y_name=
'
El
ect
roni
cs')
;

o Combi
ningCondi
ti
ons:

Mul
ti
plecondi
ti
onscanbecombi
nedusi
ngl
ogi
cal
oper
ator
ssuchasAND,
OR,
andNOT.

SELECT*FROM empl
oyeesWHEREdepar
tment='
HR'
ANDsal
ary>50000;

o Li
mit
ingResul
ts:

TheLIMITcl
auseisusedtor
estr
ictt
henumberofrowsr
etur
ned,
whi
chcanbehel
pful
for
pagi
nati
onorreduci
ngtheamountofdat
aret
ri
eved.
SELECT*FROM or
der
sLI
MIT10;

o Dat
aInt
egr
it
y

Dataint
egri
tyi
sacr it
icalaspectofdatabasemanagement ,ensuri
ngthatdatai
saccur
ate,
consi
stent
,andreli
able.I
tinvolvesmaintai
ningthecorr
ectnessandreli
abil
i
tyofdat
athroughout
i
tsli
fecycl
e,f
rom creati
onandst or
agetoretri
evalandpr
ocessing.

o Const
rai
nts:

Const
raint
sarerul
esdefi
nedatt
het
imeoft
abl
ecreat
ionthatrestri
ctt
het
ypeorr
angeof
val
uesthatcanbestor
edinacol
umn.Commonconst
rai
ntsinclude:

Pr
imar
yKeyConst
rai
nt:
Ensur
est
heuni
quenessofeachr
ecor
dinat
abl
e.

For
eignKeyConst
rai
nt:
Est
abl
i
shesandenf
orcesr
elat
ionshi
psbet
weent
abl
es.

Uni
queConst
rai
nt:
Ensur
est
hatv
aluesi
nacol
umnar
euni
que.

CheckConst
rai
nt:
Speci
fi
escondi
ti
onst
hatmustbemetf
ordat
atobev
ali
d.

Ref
erent
ial
Int
egr
it
y:

Refer
enti
alintegr
it
yensuresthatrel
ati
onshi
psbetweentabl
esaremaint
ained.I
tisenf
orced
thr
oughforeignkeyconstrai
nts,
ensuri
ngthatv
aluesinafor
eignkeycol
umnmat cht
heprimar
y
keyval
uesint heref
erencedtabl
e.

Ent
it
yInt
egr
it
y:

Ent
it
yint
egri
tyi
smai nt
ainedbypri
mar
ykeyconst
raints,whi
chensurethateachr
owi
nat
abl
eis
uni
quel
yident
if
ied.Thi
sprevent
sdupl
i
cat
eornullvaluesinpr
imarykeycolumns.

Domai
nInt
egr
it
y:

Domai
nint
egri
tyensur
esthatval
uesst
oredinadatabaseconfor
mt ospeci
fi
eddat
aty
pesand
for
mat
s.Forexample,
adatecolumnshoul
donlycontai
nvali
ddates.

Tr
ansact
ionManagement
:

Transacti
onsaresequencesofoneormor edatabaseoperationsthatareexecut
edasasingl
e
unit
.Theyfoll
owthepr i
nci
plesofACID(Atomici
ty,Consist
ency,Isol
ati
on,Durabi
l
ity
)toensur
e
thatei
theral
loperat
ionswit
hinatransact
ionareexecuted,ornoneoft hem ar
e.

Val
i
dat
ionRul
es:

Vali
dati
onr ulesareappl
i
edt oi
ndi
vi
dual
columnstoensur
ethatdataconf
ormst
ospecifi
c
cri
ter
ia.Forinstance,
avali
dati
onr
ulemightr
equi
ret
hatanemployee'
sagemustbegreater
than18.

Def
aul
tVal
ues:

Def
aultvaluescanbespecif
iedf
orcol
umns,ensur
ingt
hatdat
aisassi
gnedapr
edef
inedv
aluei
f
noexpli
citval
ueispr
ovidedduri
ngi
nsert
ion.

Dat
aNor
mal
i
zat
ion:

Normalizat
ioni
stheprocessofor
gani
zingdatai
nawaythatr
educesredundancyand
dependency.Bymini
mizingdat
adupli
cati
on,nor
mal
i
zat
ioncontr
ibut
estomai nt
aini
ng
consi
stencyandint
egri
ty.

You might also like