DBMS Notes
DBMS Notes
Tf cerstaint js one do one WL Can pi anyhow
>» Ore + many > In Loon
> Mory do ore > Sn Citpmen
= Mory be many > Ga burereuer |Aggregate -funct™*
@ average - avg
® Mininum = - min
® Maximum - max
@ total - uum
® wunt ~ counh
Avg of balance ia branch X with bal 1900
/ actect cvgtbntonce) frome —a.cassnl Uline
| .
| Gowup bY!
x geleck avg (b
account yep b
balonee >I1200.
No of tuples
x Select maui “C8 fom aceourt ;
alone) , paanch. name fem
y branch - name having
Sum of balan’
+ Seleck am Cbolane) fom aceut .N
| Grdition
Inner Jorr natural
lef outer join on < petodicate
wight ovten join wy CA Ar, An)
Full outer join
# Me raed Jo cpedfy tondibiem if natunal condaut
B& Provicleal .
Aoean innerjoin burxewe on Loan: Loanno =
basvrew en « Loanno ;
OD)
Loon jerenjeie naberal suwuein b :
x Both ose Sore ,
natur ak —
* loan, Aloft ouden Join> buvevetw.n
ruil add tuple * ee
[reso foayude PO ral pul |
ko Rost @)+ fon nahnral sught oulerjove busvewet
wil add
[Now MULL NULL Howes iss |
jo Fost O a
A LOAN nab! full oes jour
Wau be giving al pln goom poey 3 rewile-
x Nosed _swoqurusa:
<> Sok membership un
> not
—> ek comparusen > Some
> ath
> tet 4 ompty > exists
=> Net exist S
duplicate quples > unigue
> pot unique
scntone, who Ba bolt ton & anh cee:
> Gdlnck distince ars-nam fuorn bus wet
= tok 4%
pshorsr ors-rome an Cgeleck cus_name pom Geen
* hy joy too bank bvi nol accourt * '
> Selick dintince cus_name fom bus ower
ushow = us Name not in (Select aus-name rom deposiby)Seleck custome” .
Beth Loan & account & oan at branch Dee
CUS. PLE woh from bus ieweA Joon
Qoanno = Loan. Loan .no and
and
Select dastnct
uhiere — bivrerauwe? -
_bsranch -nanat =x!
(bscanchname, qusname) in (BSeleck braeh-nar,
cus_name tem depositor, account - whore
dpositer -0ceno = account, acc_no)
f© ER model fr car iniwiance company
> Customers oun one el mere, CHO
~> Fach tot bs awocialed with © (any nog eC accident
Entities |
Atlabtes ? CGostomers , cays, accident
L Narn sod : Flac
> Regn? Dote
Addn Brand fagarthre
Daivinglicente Manvfackrn
D(A Qe”,
Keno
ER modal with. ;
= cet of patients & et pedrcal Aaa,
ws Associate with each pahent & log varies post
Patents : Doctor
(
—s) Relational Mo del :
Rdlation aka tyuble:
Tuple /row
domain
TYP es & aktaibute-
& SM PAT
* Single valuo
# Mali vale + ious , Honea onic |
x (ervporte ee aceetdingly. |
* dovwed
Super kay '- ;
Buporsee of abl keys ufuich uniualy cdortifer a ty
Caondidaber Minima supetkey
Coneiden attmbute,
Ceus-id, Cus_rame , cus streot , us city, Bovanch name ass
amount, foen.nw , ano, balan
x Join operat” Js not cost afi carts ‘
a Tf we he a deren ho nO account, sv
ane Lye 02 NULL,
« Tf seme customer have fork account, valuwr
may be repalid .
se
abtsibul?> Data anconsistenty and clala. secluncaney 4a
also porsible
Hener we go for & table g joi them.
Relafionall Above
“Is Poocdunal Language URebcolieral Mehra.
L Neon - Proceckouall Sonquoge. Csi]
La These ae Pro cod fo quou a dotabase
Basic
D Select = — Ex)- SGispame x? Corstomeri)
@ Project TT — Tawrrame Coumomner) — (A.V, 1)
© Cartonan Product x AXB
@ Rename XK Janome
© Unien U
© Set diporonce -
elock is similan to wow clause
Powmjeck is Sim. +o stleck clowse
X ConmodKs ured jp Specthy moe Han ome cllribct,
(A, Vi 7) PLONNLERS,
“eean Paadud
och new will combure with all sule sows in ObRe
rlakioy .
- TF Mm tuples aw in swtahion 1,0 In 22latm 9
cankornan produck gres myn Ruplers . :A, abvibale
> Brame, is Lange « we Can stname and wae
ahob name
5 We can we vera, & fed max § value un thoug
angrogele function card by comparing wise
Q tabe with self
* Find names Q all austere uo Raye Loan
Sard account. wn Je bank. :
Teus_name ea O ‘is uatprean (bertnewer)
* Fa Foo infersectian we Can pred erp ~€-5),
| weg manasa, fend Ge recount balance
|
a Cement) = ;
balan, "decounks balance
¢ T account :b :
dane