CBMS
) whot is dEH9
anroduce d
duving 160's.
O s e d tor controlling databases either in the havd
di sk in a PC or on netnooik.
DOesn't consid er velationçhip blo tablcs.
tlas seveial componenls lie
EYeY nal in eytace Vser inereare Jolw mana9em ent
Component and bBHS
DB Lanquage Cnqine
Ouery ortimizer- optimites query lanqua9e and ideniy th»
ber plan for exe tutin9 Ihe query fo (etch the lesult
as fast as t could.
DB Enqine -CTeal or maNi pultatt data.
DBHS HanaqemenE tonpOn ent uged (or ba
-
Ckups,
Peyfor mance monitOYIqSecuig Manag eM eAl .
ode
1Pes ef DBNS'-
Navigational
RDBMS
00DBHS
DRDBHS Oh ject Rela ional
> i e vaYchiol - One to one R-Tree u c k u e
Netwoik DBH Hany to Many R raPh styucture
dhat is RDBH S
Hanagement Sys em
- Retational batagase
10tToduces duing i70'C.
relat1Onal
model Inscad ot Navigational
70TOduced
table.
relationghp
bo
HaI
Re
and in det e
Uiprinoy
keyt , toteah
lational mpd el uçeg dabobte
he e
techniques lo avoid edundao in the table s
.
subs
FDENC fDB C.
DBHS
DBHG RDBtS.
Din 1160S .in 1970'
Follooe d Navigalional DER.Relationships bl o tables u sinq
toY sioage keys, in der ot.
Dqta teichinq is slotoer cor aser because O iB Telatio nal
compler and latqe v amount o{|mod el.
data
Used (or comple x an d large
Used (or applications using
mall data, amount Of daa
amuunt e
Data redundanu is (OMMOO kep & ind eles are us ed io
the abtes to a void Yedundancy
X dBase,tric1OCOft Acen EX SOL selver, Oracle, Hs,
ibie OtCice Ba se, EOXPro HariaDB, SOLie.
Relationat Data Bace s"
L There are y ypes o sot sub-languaq
DDL Data De tinition Language D
DML- data Hanipulation Language
DCL Dato tontrol Languae
TCL-TYansacion ControlLanguaJe
SL Command s list-
commandlist
Language
CRCATE
DDL
DROP
ALTER
RENAH1t
TRUNCATE
4)
DML SELECT
NSERT
DELETE
UPDAT
DCL GRAN
REVOICe
TCL START TRANSACTION
cORMIT
ROLLBACK
h a t is DDL in sol2
DDL allows yOu to create s L sta temen omaKe
opevations Oih dat abate data stuuttuies (cchemas lobles)o
t CReAIE CRCAE Statement is us ed to creat a
database tablenae ,
or slored piOteduse
neo
dotabas e
Ex-
C r e a l
CREAT
pA1BAE erplainjava
erplainja ya
CRCATE TAAt user
Creak tabte
d iNT6) PRIn ARY KEY UTO INCREHCN1
name vARCHHAR(25C) Nor nuLL
2) DEUP- DROP etatemeqt atloos qou tD remo v database
1able, indek o Stoved PIOtedurYe
EX' DRDr databaçe-
DRUP DATABASf explainja va
OROP able DROP TABLE USeV,
data structures
3) ALTER It iS Used to modity existing database
Cdatahate, table)
C: AlRr table
AtER 1A BlE user AdD coLUHN lasname VARCHHAR2Es)
NOT NULL;
4) RE NAME-1t is used rename sol table.
Renam e table RE NAMe tA BIE user To stud ent
S) TRUNCATe Jt is used to deleke all table ecords.
L0gicatly its the same at
DELE 1 ConuMan d.
piet blw DELETe and 1RUNCAT¬ Commatd s are :
TRUvCATe is veally taster.
TRUNCAtE cannot be yolled bate.
TRUCAT (Mnand does not tOVoKe ON DELETe }vi9e
X TRUNCATE student;
vwhat is DML in
s0L?
t is used 4o build SOL queries to manipula e (setetc
nset, dclett, updae et-c) data in databae,
SELECT- SEUCT queIy is used to vetriev e a data Crom
SOL table s.
SSELECT *
ERO Stud enti
rows Ho the
INSe RT This commgnd is uSed to add neJ
database table.
INSCRT TO student (name, lastname) VALUES'DIn yto,'shair
UPDAe UPDAie stalement moditi es 1eLord s into e ah
EXUPDA1E Stud ent seT Name Dima oHeRC
laStna me -'ghaik'
4DELE te- dELETE query iemove s enries vo ta ble
E DELE1E FROH Student OERG 'name "biMa
ohat ie DCLis
SQL
Tts Command ale esponctble
r fo attesi YesttitioN
incide ef the databa te.
) GRANT-GRA Command qwes permlesiogs to SL
user actount.
tor ex, anE to qraqt all privileges to explainjaya
databa se for usev dmy o@locat hos
create a uce-
CREAIE UsER dmy tyo' @' local host DE NTFlED by 122
all ptivileges uçing cKANT COnmand
Yanhng
GRANI AU PEVILEGE S ON erplainj ava i0 dmytro @localkot
e have to save chanqes using FLUSH Co Muand.
ELUSH PRIVILEGES
2 REVOKe this statement is used to remove piVile ge
fYOm user aCoun.
ex RevOKE AL PRIVILEGES ON xplainj ova. RO
dmytto@tocalhoet
Save chang e i
FLUSH PRIVILE GE ,
what is tcL
ransattiors in c l dotal,ay
Its command are uc ed to manage
S1ART 1RANCACTION BE GIN, Bt GI ORE)
)
ed S0L +YansaA 1or.
START TRANS RCT 1ON is used to stoit a
ex START TRANSACT 1DN
data and at
ith
d0ing Maniputa tion t
a
u r
AClcr that,
-the end,you t need to comMit HanSactio
and sores
COMHIT Commit Command einishes tvanca ion
all changes made inside o a ttansa Ctio n
EXST
STARI RANSACTION
INSERT INTO Student (name, tastname) VAwe s(Ayema , shaik
COMHIT,
) ROLTBACK- Tt veverk att changes made in the gcope
etronsaction
¬X START TRANSCTION:
IUsERT INTU student (name,lasthome) VALUES(alelo,shaik
ROLLBA CK
tJRich conbe casil
hormalitationynende
zatiomsalable
tqoue
dvgh
NOrmali
t isa technique of orqganiaing he data into
multiple velated tabl es, to minimiz o Data Redunda nc
Repei Hon data.
Data Redundancy
t incieajes the site ot databaje.
o h e iswey
anamdli e,
IDsertion, deletion and updation
C4) sth NORMAL FORM- tNE
should be atle at at INE.
fable n Ahe data beese
ve
Rle
) Cach eatum skould contain single valu e
sane
contain valu t h a t
are of
stoutd
) Atolumo
3 Ceath coBumn ohould have unigue nameavoic con Cutia)
) order in tohich data is saved doesn't matter.
a) 2EL A B ,ED
where A is prine qttribute
4 Bshot
)The table should in NE
here. is part bt candidak ky
partial depe0dency. depends s dn
A
) there should be no
rather thon depel
3) NE On entue ck.
)Tt should be in 2nd NE
) There shotult d be no Transitive depen den .
on some
an aribuk ohich depend s
Theve is
atmbuPe.
and not on pime
non-pime attmbu
increa ses, pe COmplexit
AS the data 1equtre ment
tor nOimalit ati00 too increas
and the Ae ed
ncreaser
ta nto
4) NE
a Redund should in eCNE
) Tt
N O tuti-Value dependency.
is MuthL Valued depend en
A-B ,
B exis.
Amoie than one value o
tor
Asngle
value t
should atleat
mdlie, TO have multi value dependenty,a
table
tontain 3 colum ns.
B and c should be
columas
at at tNE For tAis table toith A\B, C
tndepen dent
coniains nV D.
true, then 4he Aable
T all are
bCCUS due to bad databace design.
MVD
e tf same
J0in NE.
S)SNF PTvE- PlOject
should be in N E
t) t
avoid concotia)
)No Join Dependen C.
Relation toith
matter.
A TD
4 Bise
bieakdoun
attvibute
tme
C
candidat k
are ot
depends o nA join agán
rather thon dep aA dat a is los
lost
tthe
he cinhor
cithor
On e n t i r e c k . exiet
doesnt
Te JON dependency
O enties
ned ave cealted
NE
NE 3.
6)eCNF 8oyce- Codd
Some
1 t sh0ul d be
3NF
super key.
should be
a
mbute A>B, A
2)FOr al dep endenc e (not aqllowed)
is prim
H I
On P tine 4
2 complexit
otion too nCrea