Tople Date
shata tabau?
Datalase helors to thu collckan slutslatd data, and
Databae Eunctomq
Me ane tus addheau pataining to hu sana [Link]
Datrudindancy mcns dlubtatien if dat. son-databas aydany
Collige, shudeul becosle ane mantaied and thu hacbhl ala
)alalacan conbhal data inconslstency to a luq atnt
lashech the tua entris aladt thu danaa dala do not aqru(hatis
lashasn ora of thm tos hu aupdatd ifomatin and huctha da
Date
Lot ch lims, datulau saidllo be inconihl.
Daa' acamaatncy
dotbiy may be shahtd omenq susol dfeulaua, n thu
he dotelast manaqunt ydea tan enusa hatall ha dala
sganlpbio standu
nalânal oa ideaaial dancuda forging the dokakn
)Databasas
lauthoritn chucks cheuuen aceeu to sinaitiue data ia
altunphd.
Date
Elat s fllotenal Datbaes
Plat Datakas latenalDatabau
ashen all fhe deta stoned in o - wheu thu data stordlin
lethen sucha dabasei cald mulltßetabis hatae kikucl
Rat database A spuadlut a ue Commonflds
databau lolbd
, thensuha
latioal
Cuample ol Rat datbnse. å
-phenes lotact beek et En -RDBMS, My SQL ct
datobast
called fosmns.
Qua - Eid and atlwe jul hadola yeu
quasia.
u by uuing
Dare
lomfonent fa fasle i
Data itm- datalenn iu Hha smalldt uuit oframedolat.
OA dlata elment.
Recorcf- AcOrd ua momad colseton flata itas uhick.
Tabsle lalatin - s dale is a nanad coletion sfall ocausuua
uhelalionol datal
Eields an dtbibd- Eieldaa bttaiout autu Celnsas
Primary key
Roll No. Name Marks Admission No.
Raghav 79 511
Simrat 69 662
Jacob 78 423
Yakub 72 701
Venkat 97 405
Capfposite Primary key
Roll No. Project Name Grade Teacher No.
S. St. Raghav A SS01
1 SUPW Raghav B SU05
2 S. St. Simrat A SS04
2 SUPW Simrat A SUO5
S. St. Jacob SS01
SUPW Jacob SU02
Alternate key
Primary key
Marks Admission No.
Roll No Name
79 511
Raghav
69 662
Simrat
78 423
Jacob
72 701
Yakub
92 405
Venkat
Aletid Atcad
atalau, a fll stous a unzy
(1)
Esias kuy - Ana ashich
hunee Cas
Yalu ko tach hiceudand
AcOAdka sallid a frinang
1)Allnale kuy - An ,
a fabe thsu may Be mest thaa tu fald
become
prinnany kuy aud athun duch
ded
him s declasd as
ky - hinony kus and hu alkmata kuyu haglha au
v) Candidat
Conbtnatiu hat ou elioile lo be a frinany kuy
LCandidat kuy
Prary kny Teacher Table
ProjectsTable Forsign key
Roll No Tencher No. Teacher Ho. Name Subject
Project
Tanvi k S. Studies
[Link]. SS01 5$01
SUPW SU03 SS02 Misha K S. Studies
[Link]. SS04 SS03 Guneet S Studies
S.
SUPW SUO1 SI01 Steve P SUPW
SSt. SSO1 SU02 Subhi S SUPW
SUPW SU02 SUOs Zainab A SUPW
Topic Datu
fouya kuy - Semabmes,lna kable ou bau a falad uhih.ànot
Qusia
qusy cam alo nupolati as delete mulkßl hecerds atHu Sam
dlota.
Condlttiou anl fucifizaliou.
Foms
1hunqou eßn a fen, BASE Aubisu daa fombu
mee kabls amdd , dlsplays ion thu sosen auith
hu
Mu layok
A Repest an
fenmal. 0ia kernal, frsntalaprited dlecusml Mal
monMe
D0L Qml DM Commamd
Aa datalau, heeaemutlße okjcka thak shuaudmauipt
ak olata o such as falbes, uuu et. hu lommands 1sLcl Eo
s objcl, ane called
akne
Data
thu stuclue [Link] anod
Afenikon kanquaq (DDL)comsands
DATABASE, CREA TE TPBLE ete
, q- CeEATE
hcehu shuctueof databae and ih ohjieh is dafndg nchuol
data cambe stescd and mamtßulated uin hse objics. he
lommand aued ko manifulab ackual lala shocl in catakau
au
ohjica,
to- TNseRT DUDTAALE, DPDAÎE ,
Calld Dala MaaifulatinLanquape
DELE TE ct
Lom Consmale
Liaking a Bue Dabalhau
cwat hu dala base hsougl auiyasd.
nent o mou on lo mentstb.
RollNo
DateofBirth Grade
RollNo Name CLos
Rschay 10 11/17/04
Simret 10 12/22/04
05/09/03 84
3acot
1009/11/03
Ven 10 02/01/05
Guang tablu sailh Talbl wigad
tha step.
hue You alo ud fo fuiky hu utha aclion hat qou
shat as latimhip ?
clatalras hauing Huse tulo ablu.
PreiectName RoliNa BolNo
Pocti Neme Cless DeteofBirth
Ptin Raghav 10 11/17/04
Stinatiity
Simrat 10 12/22/04
Denogaphic Isues
Jacob 10 05/09/03
ether and Pollution
Yakub 10 09/11/03
lsues bebind Bratn
Venkat 02/0t/0s
Hgue &.1 (b)One-ta-One (1:1) reatienshigexample
TeechertD ome RoNo Nome doss Teocher
201 Bela Raghav 10 303
102 Simat
Kansaljeet 10 103
303 Janes Jacob 10 103
104 Tarig Takub 1 103
105 Venkat
Joy 10 103
Figue 42 One-t-Many (1n)/Manyto-One (n1) relationshig example.
Teacher
Teacher-subjec junçie Subjack
TeocheetD Name SubjectiD TeacheriD SubjectD Subject Nane
101 Bels
Enyih
102 So
Kanwaljeet 109 S02 Math
103 S02 104
Socisl Shid
104 Tanig
S04
105
Sietce
S03 102
Hindi
S03 103 S06 German
101
Fren
S04 SOR Sankrit
S09
Feute &3 Many to-Many (n)reatloshipis established througha thind table, the junction table
Date
hee au Ha tyßus elatinsbip hatcanbe foida
.On-fo- One.
) Oneto-Gne Relatonshik - An a Gnu-ko -u setabihgs
fach hcAd in Tallenican hau omly one mnakhin lcad
en tals B, anc tach htcod n Telila BLan haue onlou
01) Cre-to - Many klalinshißs - Gne-toMay sulatin
99side
Lfalbe Callid hu Basent falele and dhu Cmau
alale callidl hu dhldfalel
(u1) Manuy- o May haa Mas-to Dang slatoubi,
alole B, and a AecOrd n faleleBcan hau mauy
Dute
Topic
fasl.
achually tso bn-fo-nan Alatenhiks uih a Hhiid
Shuckud Gay kangag
Stuctused Guny Language. SpL i ud to lomunlcati
uilh a Aelatenal dalabas.
SQL shatements au ud fo bfem task such as npdae daha
Gna datalast, ta htaeue data poma datalbau.
nalbles yeu to and pesab on selahinal tlatalnu,
ate
hich u sab of selatd infemalisn stoudia talls.
CooL) ommand
)Oata anipulabiba
cOML) Commands
languag
i1) Thassacton Aenbol lamquaqe (TcL) Commamde
Topie Datn
) Data itinLanqap D) ommand- lemmtsnda hal
andraê
MatntmacL Commamds.
a)Dala Manifulolon Languaqe CM) Command -(omaud
hat alloe yeu to Bafondata mauißulabin ig- Sebiwal,hatan,
daltinand modiftatin data saud in a dalabau.
)anacbin Contsl Lamquag CTeL) Commande lonmands
au to manaq anf tonbol he tansaclioula
hat alloD
to dokbau, formannt.
osdaiiq choqu to daabau , frmaneuk.
Cealiiqsaužaink.
Seltinq prafntia for cusunt thaniacliou.
the sQL Comimand will be
CREATE TABLE erployee
ecode integer,
Column names
followed
ename
sex
char(20).*by their datatypes
char(1),
grade char(2).
gross decimal
Guabng ables uing SL
hu CREATE 1heLE lenaanl, a DOL
1alsles asedefened uilh
Censmad
CREATE TABLE alle - nam>
< Columnname >< data p CC<sgeJ..J)
emblaya lsle sshou dchama is a follaai
uilng DhiSERT Cowmand a
h sous Ctublabas dldd n slation
ÎNSERT LNTO < falsl nome <Ccummn lit ]
Yalus C< value>, < valu >...)
Valus Cioo1,{ Rast 'M','E+, 46to.00)
The SeLEC satment (aDML lonnand) uud fo pul
SELECT ushat o_ soluct
FRoM ansich_ labe
WHERE Lenditionu ahik
Dute
9h Simblst kosin asELECT Autsiusts euesyhing ion a tall.
Uou fut mud fo pciky astik Bu he Slat-ii lchak_to
Slhct ),e'
SELECr "fROM pet
Solecking Paatlalan us
ou can fritilas nOe fom a
sihck laba by ing
Conclilion hnougk WHERE Clauu sfhe ElECT satment, eg
)Select all feth auith qndes (s) es mallbm?).
SELECr *Peompet
WHERE SEX=m?
)Select allpetu hat ausene bosn en @A aaCamt, dot9.
SELECT*PRom fet
WHERE bilh Jo19-1-1>
) Solbct all foah doq. sELECT "PRem
WHERE
pet
sbcis = deq'AND SEK =p?
)Sclectall snakes oA bisd SELECT*PROM Bet
hHERE sbecies = "Smak'OR Shecu ='biud'
)Select all mmabecata SELECT*PRom pet
hHERE C4pcis = 'Cat'AnD Sen = m')
ToL Date
ScbcBnq eabalan Columns
lslunn
ou tam alhck fautiulan lolamna by huikyinq
mams Cie, atlaibutu) indhe qhu suet Conmadl
alhet- lik
mamesandl bilh -datu fallpet
SELECT ame,bilh Feom pet
SELECT ousner PRoM pet
WHERE bth >2a20-0-01'
elminatu dufptale
Ruquesd sut kom thu suull ofaseeet
[Link] enampl,
Mames.
SeLECT DISTTNLT BuneA FeOM pet
SÉECT D2s [2CT Csbecies) pRbM fet.
48hmyeuspuciky uithe DISTIAtmo AlL; ALà
Lalasfe Aalhu hau a unckanal asqmet.
Viusing Ssthuctuse ofa Tabl
pounoan to knoua thu struchuu sfa talsler yeuCan ue
WESCRr2E I DESC tasle nama
forinstance, thu Command i DESsCRIRE Petor DESC fel ailldiplay
Fonula to be caleulatd nent to kuuscd [Link]
)
SELECT 3.14154s%
1)
SELECT nclati C)
Topc
Selict < lslumn mamr As Clslumnalas) L,lelunsm namus
As CColsmalas]
Cendiion Basud on a
h
Valas
8eWEeN
mmust
ohuator
fall ia lo
oafus
mak
a sanqe
h
falua
londition
that hu lolama
[Link] sauqe
ncludu both locueh value aucd hu fßer valu. Faa en,to
Ait Ahe itbnu nuhou ÇoH (all blus 3o fo so lbath iuluis),
the Connmand eQLalcl be i
SELECT icode, decp, qOH
UHERE QOH BETJEEN 30 AD SO
TNEST TNTO
VALUES C4D01,'Rahman', 'm', 'E4,149o.00)
ThSERT TNTO employa code, tmame,Sen)
Valus (3ooS, Muna, P')
DsERr lomnnand Canalho be ud o kake er dutue salus pom ou
Date
SELEC PRoM baanchd
WHERE gres > toco.00
chanqd ulnp hu kHERE _ciauuk, and hu usdata iuing Mn Str
[Link] nus tlala Can be ashuifad levstast,an efuuioran
clata frmn cthethable.
Pos en-to chonq eu
huscosclu luel RoL efall ibmu to2S,
ausauld usile
CPDATE ibms
mee shall ausib
UPDATE ttm
SETROL= QoH=00
foo,
WHERE code <<IO40
aue he enmmand:
UPDATE enfleyu
SET
WHERE
Cqadl
Dats
6 dleb semi data fom talli, you tan 24e SpL DELETE lomaudy
abb.h slmowHe tntiu houst, mot iniidual falfvale,
DELETE Feom < talole name
CwHERE <freclicole
DROP TMBLE CTA ExpsTS] <fallename>