0 ratings0% found this document useful (0 votes) 714 views67 pagesSQL Handwritten Notes
SQL handwriting notes for SQL full
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Qota _°7
Avy meoudveati +hing which w present oxeu
us inthe feat Wumbus , chorcclars 0 pruysicop
sbjects py trewn % chat -
Prfowmedion +?
- A collection > dota ‘% known o4 Suformati on ,
\ Siformestamn
| —___—|— data
Snpormattson E
Patobase'.?
4 ova container t which we ,
| store a dota ee mous
Ving Kota ento the databo+ ,
Bosed tort
ite Petatnoeclouies oto * difyaent mo Aule,
ot File System DEM
#Hiewrdricol DBM
A. Netuvo sk DBM)
4. Relat af DEM
|. Fis Sytim DBM 19
Ly This model 20s introduced during the yoo 8
1950's & (960's da this model ohne OU Het
| data &; Pnformotaon Will be Stored wm Hu form %
UII a tol files +
Lorshowe “He fil hod’ wo aclotrmmslip ameng
tiene cass to which hoc a jeoa es
wT Coto, Avclundow
at Tae time tobnto seas Lor dato OY mfor niatin
will be wire -
rt
Scanned by TapScannerB Note «tht fu caystom DPRrO Vv ecommrendlend Ply
Hap Hu ctato. to be maimtoand menimeunsy
oe ie »
“9 Hicioaclsical DOM- sprmattion whl |
"3, Nekcoork_ DBM) +
Lust like Hittarchical DBM, he ee year
whormadam fn the ForM i é
pre a. is U ie et cloth over He nate
ich the dota dadtundaney Wed Acc! ud
Que to which Cee fasts oben compass
man. G Stasehing
Ste PLAN ad ae raswwoddh 188 10 |
b nrotlonge modkt wow |
ts cabot beny dion 0. Sing noske ib the Gu
embire moll wih be shutdewn:
‘4. Rulolomal DBM:
lo This modk vias tnt duced by E-F code dluting
rte _yeau a, IF40's :
bythe dato ov intosmalaon will be -sfovect io
Ate oom », humours teabls.
jy Tite tabll» will be conmeticd to cochother with
the Dy Primacy ky & foreign Koy dtu 40 which
His dotad Accuncouncy rats comnpUctely aedueed
& searing Joe com’ jest hes! ‘
btw model wos jpeciedtone &| afpeitaenst ool
ee tee ee
Scanned by TapScanner"sau: i)
pe ieee nore waurne Bi ae b paces Qua Loxg
chu Guete Tongue
ne longs Ural seduce ae itd
lla b nold 1 Drownbeuting "beige Z Co
an IBM) «
Wf the oF
re “rian 2 eee ohnrdanndl
with tu olato
pens *?
pps Bhowds 4 Dota Bost Neunagimunte “By ftin:
ela vs WH ko
1 Sew a Auphwoar! volt ek rie
Hae dota & 5 aligns us tO fh an
It Lom be inaction up actin By cater 4)
15 Ero Aopsnor 9, DeMS Rey '
& FouPIO s
y Foy Bot i
a D Rat @, 400%
ROBMS D
RD ds or Rowson
RDBMS Atands Jo PBB, ns rahi ys
bE odw
ae gle cee he dota more egpectent
anag> “41g Atore tie, dodo in the Los A
bat ane te with DBMS. 4 »
pT RDBMS has oot cirhounced Seuntly feokuses,
ood pafpremonet ¢] Yoo t at com Aldre: huge voluuve
Agta tnt Ie chatabost:
5 The Enounp. Aaj tevos
4 Haocats a Sy
ave Ag
Me access
* Mango DB
4 SQL SOW
RDBMS ue,
cust E& Zoom:
——
Scanned by TapScannerRock &d. @
ust
: z= Juss PDotaRase .
|agptrpieahen
Revws [Columns
1 fel a:
—potuples/ Records froces
fetds| alii bucte | columns
1 Table [Relation [Entity
Dato detects
- ae udsict the trwolid date, entiaing
bgt ts wud to te tha Fable
cng eng oe A, dete ai bg 0
%¢ Dota kyps
& Cowstsaints
rae without dota ‘tritega
Employu Tab *
tare Dao | Paame Fiixdato | eal | es
Too | sting meal ee
Soo uid, | clot
yeu sree
6
Ly Np Soros Betead
Scanned by TapScannerpate —-
5 ato. typ pes OFC used to -Sptciby tha dake. to be
rowed in Het cach cColumus 9) tu tables .
pte Ahh} pexent are b Doto types ety
y, Neumeric
a non Namie *O ED type
s, pote Data ae
ase Pato t
dota t ‘ype whith » Used +o
yor af
“ase mune ee oat et the precision
4h ۩ m > the tole .
ee q Nuwke (4
| Number (Size | Length)
Humber wile prudsil
hs oe ofp dota type which i wee ateig
ith the ion His
w prects
Ob
So aeeta
+ bn 9.99
a 9 Numtbu (53
aaa
Aube > precision)
g-Non-Numeie Hota tye
res
ied in which w usd
le pari. Vobust OY only the choractn
ums 5 tu too
safe | [tonath)
1, Varchor orc ond
dk iy Vasiabl. pine which is Usect to store.
Bn pumnbuc Valin sy oly the oe, yor
ded nS Oh Hla Valor:
Scanned by TapScanner
to stove
pes the.hove Upto 000 Valut, Y
| are dotat tore es Hoob Voluy —f
Sytor ,
vaxchas/yaxchos a ( Ft! Length)
au é ich 13 usted 10 by,
hich
beat 2 2 Ape nde pe whieh tra
tbe lle tate dgcuult: ferred Oh dott otoctope
vB
a ‘ i.
poe npont- SS" pe date ~mornth iD
Employ .
[2mpno Ename [Ono | Orowre [riredate | 2 [Pho [Pama
‘Voy Prnga lov [Testing Fey) 401000- 143
ie ! |
(L4 t J
Number (3) | Namba(a) ‘| Dok Nuaelady | cian
ys
\ Vorchea (ao) vaxchaad (15) Niebats) 4
I = |
Consotnts
1 } ° I cd
u bt acstaicl tu ewNot
pCemtoaies oe as
Hc
by the chat fype oy Ov
L & No
4 :
*Null
& Unique
w Patmary
e doscige key
wm Check eovstiaints
Scanned by TapScannerYi Nel ome
UL emaasths Heng, anes, tloawt garnet ;
rie value. 08 be present tm the’ selected cote
men toble
Const vanile
wee oa tha Aupticotion op voluus ore not
8 fr Acted, Columns vy, Wha “tolbte .
_key Consticuints : |
ers Tp comtinhien fy not- ull 6, wnique conels
wv Ho ‘edhefi We records us
seer ipobmasy key com fit) HH oO zing!
beg not fat mon deters but i
beading @ @ pinnae
Teal co es Nae OL a oe oa
‘bat called db Comdidot keys .
| Perae cituiind ohich axe ligt il to doe os
| ne 5 eolunnw but not coos OS' OH
2 en by rolumnne codled! as a
LW
ee pe cwostunw ask or the additsonal
Vaitdation 0 the auquinemink Hon we mage use
awils Mi
+ 1
Dro |Qnome Hiredate | Sol | Prno
100 _\Tésting |Vr-Feb-Bpar|teroeo| 143
{ |Q200 \develop 01 -Jam- 8081 wee
‘Ibo Vrestang JH-Nov -808| 85.000 | 458-4
\ 4 4——
~ Y
: NN. Chick(sat 7000)
Check (dength (phi)
|
Scanned by TapScanner* Foseiqn
dt ts also cold au onpeer ie ee ok sunt
bfadian sy is used tp cooate Pap git
ma consteaivils
tle 4 tha tables the “cob
auhip bw w 10) cobuy,
‘Lyte ela ie stl vacant i bots tht tables “|
coun a5 to oC 4 iy altoweel 09 the
qohoore a ow
singe
Hf sl ae ky ‘wi accept alupiteods o bees Vous
cer sheult Morluees
Check(Cengih
* Empleyee nc thd)
Tnoune “Duro Drown 1G cdoute _Ssav Phavo |
top [Testing _ |1a- Feb-aeai|anoog 143 |
Rew elop Ol Dam-@) [45.000 123,
Heating eae al eto U56
d
poretge iM
NAL Cheek ( fas >d00)) | 0
ny
Scanned by TapScanner3Q). gotererts] Language .
po
parC Pato. Query Lourgu ¢)
rou a oa eeieg
, RELCHako opinion Lonngucege)
b frcate
Alor \
Ly Renaune
Dpuwale
neha M y
a DME & Manuplication Language)
b dnsut : yee
| b Upolate i
LPolete ‘
x. TCL (TRamsachor Control tewnguse)
or”? pri (Sata “Taarwacson enguuang.)
by Cenwit f
b Rollback hel
b onepounk i
ok. DEL (ata Covilact dengue)
by baonb
bPwoke -
1 Pen (Data. Guy Languarg’)
Saud Saturend * a
ide ts used do form, the quakes
Ly Tha Copabitities o, vetek Stalevuvrt ot»
1. Paw tettion - tf Used to select Lhe columns Op the
4
|
tobk £ id
a. Sule my - Sta wed ty -slect the ows o, tle table
3e Tein - SE to used to, fea tle dota yr tle
piw * a
| sagt pattes
i
Scanned by TapScanner: Sy tan | : ; is)
Setect & / § [bishine] column Haw Copui, j
(Aiios. Now: J {rom take,< None 5
Baste Cowumanedls § Basic Quesies
J — =
L>SMow USER;
| jUSBR w& ScorT ( ee
“hsshow Uses ¢ it Awws which wu & ie |
| Sar >connict @ CONN:
Hua Uset-nane + MR
Ln password | eeare (1198)
, Counted «
"SQL >SHag LsERY
FUSER io TR. j
5 Thts conwuvwand %» used to suite; fon on
WH to omollur user Without entl-
{D-SQr7 cl ScR- aOuon
dt w wsed to Sloorthe Serer =
(®. Sgt? StLECT * FROM TAB Y }
1. Non ThTyPE — CLus7@RID
ENO Gs
1 Dro
de vw ustd-to » chuck, echtels, all the cata ~erttrredl
svt table
Corse -tesiah
Ogerrpesc wert
tht -skucluce % elle Aub
bb sl. to kinovovs
_Name ‘ Naley 1 ype
Scanned by TapScannergHay paaesizt
egize 14 :
ae Sor LENESI™
ponesi2e $0
sae 7 St Prabsize 'ovs
36L7 Str RINESIZE lov’,
sat? secect #TROM UMP}
| ate a. query to Aisploy “employe table:
gah 7 SUlec ® FROM EOP 5
qantt. a quary tr display, dll the
6QE7 SELECT Enouw fon ey 5
white o query to display all “the cvinplayits Marve
conde |
SQb7 StLE CT Enoune sob from @nvup >
yep loys Freuve
@.964 7 EDIT
b This conunourd ip usich to eckit the previous
Conumond 1-2-5 Edit CEA) i
ae 40 paptepocth eoe com corvect 7
OH will nowt]
sthue fun close tab & gave
then sar Using Sie
4 Oth Konuru will rer
| Aiterols
biituals con be numbu » dot oF chee Ceberculs
{i> date § Charorler tac shouted be enclosd)
both Avge coll")
bub we wont to perform cperataos om inclapeust
Uesods dom We necd te make ws of lum table
Caled on duol taller.
Scanned by TapScanner'
|
f Exonnplo : 43
Seu >seLecT ata FRav) wep ; 5
+a
oa
an
SQL7 SELECT 44+ FROM EMP 4
i Net 9
| ae
fh 6 1A me -
K 6 ;
) Ih wows’ &eleeted |
| SQL 7 SELECT 448 FROM DEPT ,
| Hah Oe oe
BATS
+ a0ws selecrds:),
j
(SQL FSELECT ENAME,SQHs SGL*IA FROM EMP,
ENAME SQL SQL#ID
| SAT Bod. 9600". |
. é \
A : ‘ ‘ A
1H aows Selected
\Altas name 2
1b is a atteenative name which, ts given i
|-the colts nay
|by Bettoeen the column name G alfos name we con
tue OPbonod Keyword cottedt “ors”
Lohen we want to Hiovide ter Space im the
OLos nome ther +he alien nome Should be
Wake Wse
1 enchosed by cdowbe codes
EE ee
—
Scanned by TapScannermone promt 1 UBL owte) Ide” igi!
rn v not ging sy asd
tite
Rp As SALAPMA FROM TMP 5
Leg Seect 1G
| spe R }
Dh ss colectrd
ope 7SELECT ENAME 9SPE 2SPLa 19. “PrinpLSALPRS"
" FROM) EMP
Gf EN PME ___Bninide =a
SMITH 800 eee
JH sows #clected
- Concatination preter
Tier cadena ey oe
Hum We morke Us
vs dine cokuund to Conteate
g, bee yeatscol boss which is Apron ai
bi ‘
BS, op, >SELECT ‘SOL lictnss? FROM DUAL 5
S@icunss
& Sq pSEeLecT ENAME
ENPME |ITOR -
SMITH OLERY
(1JoR FROM EMP 4
1A Aows eelected
&8BL> SELECT eNnme It yovesntnkyts? IGA
FROM tMPs
SMITH YOUR SALARY 13820 -
————— |
Scanned by TapScanner7
| Choratms
b used to perform patio Lid»:
‘denn ae the o ee on? eziling
_condabsena Tht Gigterent type 4) opoaterr on,
| Paitinetic Operator Cea 1)
Tw RofiRetoti onal Operator (pki 271 ic, syle Hey
Hl de hovicat Questor Counel br Not)
&. Speciok Opuiater (0 take betoveen x
Oadufaluatid psa
, feb te Avithmels
f Concotinalim
3. Rolotaonal
h. Ts, Like 9/0 |
5. Betuxen
6
7
4
Not
SELECT fs[Orsrinict colunin — wine | Supression
|
uns- name) 4 d4rom “table — NAME
| Where Column name < condition >> -
2
]
Scanned by TapScannerphere clause Bud to areleck te
words 40 be Lisploujedt Lergtt qtves tte apea
qucorels the output based oy “(tie -berbaiwm f
condition -
pptsplow all Ui employes who ore corning
More thom 3000
Lp SELECT # FROM tmp WHERE SAL 730005
5Q\
| oR MGR HIREDATE SaL C DEPIAg
| erro NAME
| KING
SOPs play OL the employ. Who Tob wv _momogut :
LROPNAGER? §
| gL rselect * FROM EMP WHERE Jo
Ly Ddploy all the employs excopt who wok 5% Dr
SAL 7SELECT * FROM EMP) WHERE DEPND | = 103
bist abt the clerks in Oepno= a0 ,
BQL> SELECT ¥ FROM EMP WHERE TOB=‘CLERK?
PND DEANO= 30 5
Ly Dsploy al ti salesman whe
thom woo £, belongs tO Depno=30
LIHERE TOR =SRLESMPN’
o AND DEPTNO #30 5
wv vouning MOS
SQL> SELECT + FROM EMP
BNO SAL> | 401
b dis oll tin employees who
Pepto 10,20 06 30 _
Sar>StLect & FROM EMP WHERE P
OR DEPIND=90 OR DEPTNO =3° >
sa oreki ng,
Scanned by TapScanner™
IN Operates ts used to enone a al
Vous tohen woe make Udt a, tH o- ep an
more tun one me twstrod 4, 4h We Lorn
§ calted w IN~ optiattoy
“use yt Apedio- hey
i ‘ Wiptoy oll tHe Qian ployta who working in Repo
il t0,80%30:
“SQL SELECT & FROM EMP WHERE PePTNO IN(10120,35;
@Mesplay alt ta employs who _w_werking clark
i flr wvounnge?
-SQLZSELECTKFROM EMP WHERE ROVING JOR
. INCECL ERK? MANAGER?) 5
IN OPERPTOR
Between Operertoy q
| b2tu used. +o displouy He output ov He Yang:
j Oe role .
bh we wse Between Opecorter , it shewd
Tbe {ottoed by and cheeatry clio.
, Revloy atl fhe Unplo yer who BU caiming the
\ Gadesy belvovn dhe AGU4 O lovo & 4099
SQL> SELECT HEROM EMP WHERE
SAL BETHEEN 1000 AND Hoo00,
Syntont
Gerect efo6m fable rome whet column — none
Cheater news NI Oma Vy 5
Scanned by TapScanner= OO
| Djploy alt He employees whose ‘
galrSececT® FROM EMP WHERE HIREDATE
BETWEEN ‘IT-DEC-80? HND‘3-Dtc-8I" 5
| 1g Opratoy
yds uscd to Compose wrth the null /nol-not
volurs
| Dosplaw alt_te erepleyus who don't howeAMportag
‘ fauroges :
| BBL SELECT * FROM EMP MY
| Diplay all Harcusploy tou alt cs who ose getting
Commdlssin -
SQL > SELECT & FROM EMP COMM 1S NOTNULL 4,
R IS NULL Y
hike Operates a
t used t nM ran mating
odt b i we fo rnockeling, olin Ht
wwe com OUWieve ii pi
wild cords 1-44 2 oo anda, ; beh
Lyynodals(lo) St modchs eoite sing 40.9-¢
mets with singh chorale:
by tunduss ore (-) Mt
Pisptay att tte employ
SHLPSELECT + FROM EMP WHERE FNAM
Diplo ody tn. umnploytts Whe nome showing tatty Low
Brcmd nara cor
SHLPSELECT & FROM EMP WHERE NAME LIKE
© _L%*,
jaro olas w honing enact Abu
iploy ols the Empl
SQLYSELECT KEROM EMP WHERE SAL feet
|
Scanned by TapScanner
who name ¢tor® with s-
,
Ee HIRE ‘SIae
F Assignment jo
“O94 alt He emplo who ort WON
Peeples number 03 Rabe or, 1934. ‘
9.06 all the Ymployees who howe joned
bo the. h © Jon. r o
1 3.01 AK the employs wosking in No
4 10520 ov 30 § Employes Locaing ou Cloak te
i Salusmanm > cna i
A. LEE Ot the enfployets woho nowne not —#tasts
votth tutte A? & who's solory move tan |000
Bobs te Aepartment details which ‘are as
“Aut '0° 19 thelr Vocetim as welt cv in there
lush -
| home -
4 by ONL the omployces whoa fob ov Sting
| pram Pee q J 9
+ Rete ay ee empleyccs who arr galesmom
_howing, ‘Eo cw tHe best but one charodler wm |
I emp noms & Fala, Ahold be howl ng
exactly HA Nous Wo tt
j'3 Disploy OU ta Whur enaplo yes who howe
“joinid offs fhe yor 31.
(4, Qisploy aw the mavourer qi whose saloay ‘b
\ ending with 2u0
to Que! an the Pr tp ees whose nome starch
wit ae yw’ geet,
i
Scanned by TapScannerbus pe eee Tob May +Hixedate PL Comm Depth
739 Smith chek 7909 ‘IT-Pec-$0 800
1497 Alle. 4blesman 168 a0Feb-B) Iboo 300s 3p
768) oad Salesman 1693 aB-Feh-8) 1250 50D 2
| 1566 Toms manag 1839 oa-Apr8] 89715 a0
1654 Maxtin: goluman + 1693 @g-Sep-8) 1850 1400 30
7698 Blake — manager 44.39 pf -May-B] 8850 30
4398 Clark manag 1239 4q-Tun-#1 450 to
| 4983 Scott analyst - 1566. 19-Apr-87 3000 20
4339 King prstden 11-Nov-8) 5ovo iD)
| 1844 Turn Sees 1698 08-Sep-31 1500 80
AS16 Adons — closk 1188 83-Noy-§7 [loo 20
4900 Tomes clerk 4698 03-Qec-8! qso 30
4908, Feed analyst 1566 03-Oec-81 3000 ao
4934 wttta = lav 116% \B3-Jon-83 1300 Io
1A aows Selechicl - :
Pept tothe,
Deptno Ong Loc
0 Accom ng NewYork
ao —_Reseaach Dotlas
| 30 Bobs Chie
| HO Qhuakims — Besteh :
OseuoseiecT w TROM EMP WHERE empno £4085
| IN (1908 51934) 5 aN
ants
: E HERE HIREDATE
© Ser > Setect + From EMP WHET
|@ SQL> select * FROM EMP WHERE DEPTNOE:
2 AND
yw (10120,30)5 — ——_"™ [
Bg. >Select & FRom TMP puarel TOR -
1 (CLERK ‘SALESMAN 4 ANALYST) 3
Scanned by TapScanner© sgi> serect & FROM EMP WHERE ENAME), 1
Like b&@A%’ RAND Al
‘ 5G 1> SELECT ¥ FROM EMP WHEPE\SPL > L000,
. C
"G) SGL7 SeLEcT a FROM PewPT WHERE 1.06 gbiim
Like 0%? pind Nome LIKE 10 “lo? |
at
© 881 DSELECT © FROM EMP WHERE TORMS !
i LIKE "Co mong
@s SOL > SELECT FLOM EMP LHERE HIREDOTE
“6B >='ol-JAN - 82? p3te Dec -82
©) S8L >Select * Feom EMP AHERE ENDME
ike a. A» %N? 5
@ Su >SELECT FROM EMP HERE
ToEEsHnnageey tree © Yp0? 5 |
'6 SQL>StlecT * FROM EMP WHERE
DH SELECT F ot EMp WHERE
SARL23000 AND TOB-! ANALYST 5
|@ SQL> SECTS FROM EMP WHERE
JOB = ‘MANAGER? AND MAR =1839 5
@ SQL> Select # FROM BMP WHERE JOB
| NoT IN (SALESMAN? MAND UER™) 5
il
Scanned by TapScannerwhledte o Query a Aiplay fit Annuol salary o,
no Kone “is Smith
{or
vet
t Moet Gu 4 diploy all ttu employers ley
a, Salose) and w thing ow
a eartn cee Ow
iP matte bopailodialt te ayes ie
ranking Os 7 ee por to Cede
1839
parte > una day ont the om
eat goftsman E manage
a pitts o Guay to derloy detal ls o, tin employer
Hose who hawe hived: duseg Hee Geos: 7.1931
Te Rel. 0 Quy to, daplauy OM Aes empl yt? Oho
ane” hived ral iN ay 3 ol “the fate
14. Wosk % Quan t
Hinge who Ot viet qotin b Us
G@ Aist- the Employers those Who ase ce working
ab manage & Ubi iw dagieo [0,20 Wh the ad)
w tr Yous fa 3000
ia. pees pe, ormploytes «who ay arosene rie
ioe ae ie ns nome Starts -
ne alt the cmp
ie
with +g? oF o the emnploycrs tbo (088 gt
al. Oi tay v trode
| amd. va solar toy? , ae o's none 4 toa
lag. dist al tos ate cht
a a 2 howing actly
ane cult thee ene ere ,
DD .
wcks oe
5 chasacl vw
aa Lis ot the ample?
otteart Aun Ale i a
wko's Name is having
Scanned by TapScannerF@SAL >SELECT « FROM EMP WHERE =
“HIREDATE BETWEEN '0I-JAN -81’AND *31-Becy
j © saL> SELECT # FROM EMP WHERE
ptIREDATE mee NOT BETWEEN *O1-JPN~gg)
AND *31- BEC-8a° »
1 S§L> SELECT & FROM EMP WHERE SAL IS Ny
4, ®, SaL> selects FRoM EMP WHERE JB Nor
HINCHOPNAGER » FCLERK ?) AND DEPTNOM{D, 20)
ND SALGETWEEN 1000 AND 3000 ;
Oo SEL> SELECT FROM EMP JHERE
1 SOB= ‘MPNACER? PND MGR 1S ator NULL;
Hi
*.@0) SQL> SetecT * FROM EMP WHERE ENAME
1 LIKE '8%, RO? PRENAME LIKE ‘A%? 5
@) SQLYSELECT & FRom EMP WHERE RDBMS |
DEPINO=a0 DND SAL >= a50v 5
" @ sOL>strecT # FROM EMP WHERE ENAME
Like 2%
, G3 Sgr>SeLecr & FLOM EMP WHERE JOB
de
i J
1B) Spry SELELT ® FROM EMP LHERE ENOMeE
. LIke Aol’ 5 /
ie)
f SAL > SeLecte FROM EMP WHIRE
\ HIREDATE Like © 081%" 5
” a
Scanned by TapScanneres
@
2
, kote mers Lonquoges
fj Pata Keffnatin Longungs
‘Carat bode ment + Thes “statement i» ed to usd]
et into Cate boue
ze TobteNoms
Cool atts Data Eqpe
6) constyaurt ) 5
e(Stze)
Column! Moko Typ
C . (ste) conse vant ’
Constraint »
Juana n Bakortype (St
Exam. : ;
Gat tix following tale
PRODUCTS
Prod ID(PE?
1 ProdNoume (Not Nutt)
Oty ( Chk 70)
Dacipam
ORDERS
rodld (rk foo PP oduscts)
Onde 5
Qty-sold( chk 70)
Pail
Orolu DT.
SQL> CREATE TABLE PROPUCTS ( PKEDID VARCHAR(25)
Femney KEY, PRODNAME VE-RCHPP (25) NOT Nuy
gry Numate (5), Dt SCRIPTION CHE (58) 3
Scanned by TapScanneri are TABLE ORDERS C
Sez CRE aes A ePERCES Phoned
PRodID vARc
PRODID) oRDERIO NUMBER (5) pone Kapa
gry SL? numer (5) CHECK CON
' Peta nurnBen( 818) 9 ORDER —PT 7
‘
qBCustoner
Lycetstomu —id ( PK)
Lb Fixst_name
blast_name
i DEwail- ad dies
Oades!
L Oader - tk (PE)
Ls Customer —id (FE)
. BD ader _ dota
{by Ondss- statis
; Be
| D
cuatr Tally Patirewt
(
f Patiend_ id vaichasCic) ‘Falrnosy key
. Potionk-name vorchat (19) rot null,
= PAA Yorcho4 (av),
‘ City Voxehas (6) '
F t
SALS (ava Tabi Prvotce
Podiert ich number (16) of erences poli out
Taverne nunrbet (10) py,
-Armowt pubes (to APrieea, by ,
Trice At oleate) J
Scanned by TapScannerthe folladn eee
b (rate He Folland Teble, ane)
I Table nomt= Students
dugno( PE)
pdunc (not ml )
Buty
DoB
Plhrove
j) Tove vow + Books
|“ bovkno (Pe)
| brome
| aucthes
| Oat. rome + Libro.
Begno( Fk fom etwolents)
botkno (FE prem books)
Dol Gate 9, P34)
Dok (dete @ stu)
8 Ouplitorting “Teubte
| sng 3 tabk sem anctfur table
body wd to duplicate atl flu Pods 6
chorct aishes Op, Or table to an Arter tacte
Bun ne
a TABLE NEW_TABLE NAME PS SELEET *®
“Feces EXISTING TABLE-N Me »
| Pnovrnpls *
SEL» €auals tobl. Demo
AS
Bele, & From Dept >
Tabts Cvated
Scanned by TapScannerSg-y DESC DENDO
ks. Name NOLL? Type -
Rept Wo
4 Drow
doe :
¢ 86L> Geleck * From Oem $
i Amant Akodtemunt
(eee
Me eae -eloliment & used to rernove oll t
fl dota peamonud but te steuctiire Dy He
table wit Auman Same-
i Senior:
FE bx Truncote tote tabl_name ;
| ons
SQL >Select + oom Lemos
Newnes outlive 2
Qeptno — Onamt Lou a
ty \
2
2
| t S§L> DESC Demo: Stl rl
i Nout Null 9 Type
i. Outne
i; pow
I loc
f SOL? Truncoli tote Pewo i;
I, Table euncolid.
aqL> Att 4 from Deno,
ho wows Selecked .
Scanned by TapScannerBeailemer
"dso
Pos. petted umd to rumove both 4
sat a watt as fe Al otane 44 “the totrle
son sop Fable Tolle rout 5
bs SgL7 Gate toble tut
ous
duct & Prom Pept 5
Tarte (aeate A -
gq. 7 Select + from teat 5
Deptno Prowse doc
ggL7 OESC test;
Now Nut? Type ;
8G L 7 POP tote tert 5
Table doped
S89L7 Select & foo tests r dost
S5L7 gape se 445 { Suit
Flashback *
Ly Ayton’
Florbrtack table table nome to Beare Powys
Ly
86L> L> Flashback tole tebl to Before Pep :
Flaabbacke Covnplet 'y
Pus
pc Purge Teubte Abi -name 5
be ean tole Tut 5
Tabu. pus
86> Fal pack
AN" Fave an ne ae Bsfave Bory,
Scanned by TapScanneraa]
Recycle Pin was Snfroduced 5,
p, the tae Was ben
thow ;
; afore tb Ubtng the
| om
Loshbvack Commo & cap toe Ct i |
i tit dolce prom Ut dato: ‘i
ag P Commonc
, OQ Rlharstntirenle
@ORuame:
| & aenouns
£ Sy nto ie
: & Prnamtetovl.— now to now — tout. now 'y
' é
f “eg L> Rensne Soumple, to gompte |
© table ouaseol 5
SQL> setrek # from amptel 5
I ivy aces eartol y
{ SEL > Zelict + from Aamplt 5
CRROR ce emist
| dloesne mis aulp 2)
1 (©. fitter Bakemurt S—
|‘ Ly This Statenmunt usd to ally py oo dawg
to Hu Aburcbiat 9 Hu table thot meas +t com
Hike adding the Columns} aumoving the colts
for aonouning the columns:
table name
Sy nten +
a
To cdld_ 1 nu column «
ATLER. TPBLESTABLE-NAME ADD COLUMN NPM
| Dope (s1zE) > |
i
=
Scanned by TapScannerv be atyvouns dhe volun.
purer toto Fable nawrs weno column |
column —Nowe
n_nount 60 nun
tunn
(fh
5 oe tw 8 :
TABLE table-nowme PROP CoLuMN column fable
free rn ple tavle name
DROP olumnnowwsl, |
to
Sat
36 > CREATE TABLE SAMPLEL
Lect * FROM MiP 5
SE
TABLE CREATED
8GL7 SELECT, * FROM opm PLELS
R TABLE srmpPled: AO LOCATION vor
cha (13
S6L 7 PLTE
Ly PUTER TABLE SPMHEN REI
MGR to MPNAGE R >
ER TABLE propel DROP
‘pom ne Prop (Gr 530) 5
Name COLUMN
i)
CoLuMN LOCATIONS
SQLARLT
ggL7 ALTLe THBLE
Lato. Manupulotio Lounguouge (om)
by DML atodenends Oe used foy MANAG
| Mo database. DML skotemuns Ot 10!
| custo ~Committe Sl munns chon’
to databos -
DML temmand oH not pomanonl
4 com be called o tack
UWBPaseet 2 Tes tab. kodement is vate 4
dato
jo ener date
nm the tote - :
nse 9 t
Dnt suntom Tsnswt boto tablenowne values (vi, v3
Gy
On Dp) Vealues (Vio),
Saute teclo tobb, Nowe (column
Scanned by TapScannertrample 0
AY
~ 8Q 1.7 Seteetat ROM propucrs 5
18
4 86L-> DESC propuc :
sgL> INSERT INTO PRO apoer & vorves (leo! s/ PPT,
1 SG L> INS
lo $DULLL?) 5
| SOL PSCLECT ‘FROM pRopocts 5
* SQL >INSERT INTO PRODUCT s( PROpID, PRODNAME)
ft VprvEs( 1008 9 CPMIERN’) 4
SQL> ab CREAT TABLE DEMOI2
NS
« StLECT # FROM PEPTSG
9 5
| Sgr select + FRom Demo? 5 .. 8
vi
f aa INTO DEMON vave (QV 3 ¥ 3, § V3
5 Enter ee foy V| +50
Eni yolus for Va % TEST
| Gtr volun fr V2* BNG -
pod | SINBERT [NTO Demon
ROW]: pISERT INTO DEMO velues'
yn cvesCi§VN G25)
(¢50°, TEST’, ‘BN
‘(sow coated
(@ Qebete Commend
ui b& wv wel to delete dotor from a faible .
| Ly Delete vormmawnc vom eulso be wsdl eit
fa condition w delete o pasticulas row-
| Byhtom
i DELETE FROM TABLE NAME GIHERE
pene
- =
Scanned by TapScannerfyonsttt
ae yale TEST
crent 7
aoe
ot ec! © prom EMP
e. 1 : N a a
FROM peaR Teor WHERE ENDME = mailto,
A igtot Atma
updote ont or mole OW» of, He
dt v wed to
tobe
Updo eave -ronne “ade cotlunn = nouns Vout where |
condanrn 5
\ Warts a to updode Aol i
Sk bo pod Beaty €, also a “the, bord
t As Loc AB6%
FE \wo whit Env plays fo.
tobe vert
|
|
|
egly weapons bods
a
| Jpburk + for Bmp 5
SaL>upppre TEST Set SPL™ 3AL4900 «AOD.
Commz loo WHERE
TEST SET DEPTNO-NULLWHE RE
empNo= 12364 ;
|SGL> UPDATE
: ENAME -“6C0TT 5
g. Wnits a query to updos Emp nome - scott
| AU duh’ no vb
Hote o quay to Uy
lo "lo
SOL> UPDATE Test SET SAL= Balko! §
rdate alt the Emp Salary
Scanned by TapScannerDel OY
Comer e Dade’ @ DML
ee t. Commond |
use asble com ust uohary
we le ue weld Hs | Coa
f ol
jr Used ty aemneve wise ot Hee
“tte accoids rom He Wie gon ‘ia tebe
« apis!
; a tion Caitecl Language (Bata Taanrsa ay
é tow
‘> Any DML change on o tole 8 not o gormontal oy,
Uwe ned to 4ave the DML chong i? ovd to )
{ moke tt pumnonert , j
Lope com alo uvolo te Smet same DML chownses
I en a table «
| The DDL Changes connct te undone ay they axe
I Tmplicity uad ,
P GROLLBRCk Suntan + ROLLBACK 5
i SE uncles tht DML “chomaes perfounc ny tual
Pr OCOMMm LT
‘ Tt sows the DML chomats permanently 10
Vie dotobore »
, By low ‘Corny irs
| &:
| £e> (node TABLE XYZ
Os —-
fuk & fyrm EMP)
Scanned by TapScannerMgr oelett Flom XYZ 3
yous delet .
SEL? ROLLBACK »
palbock compli: of
ggi.7 commit 5
corn complet 3 :
age? Setuct we fom KY2 5
[po 20s seed :
4L7 PovtpAck >
paibock, completed
Sone pint
he GAYE POINT stodemot 1
fe cursent point m the procs
lpWith te RoLLBACK To tater ,
undo pas op & trovsackion instock 9, He w
- tamsacio -
BOL > PELETEHFRIm KY2;
Ip ws Lilded 9
© Sywtont gavepoint sowg ote name>
‘AolLback bo Sorpoling Sowe pal vt hang
SGL> DELETE FROM samp LE whee eEnAM <4 SMITH! 5
V3 seuss duletd
SGL7SANEPOINT Fs
Eosxpeid vommplult >
S8L> Dek from sample vuohue Enome ='Seott?;
3G L>Soveponndt Bs
| SL >Neests from ample colrere Encury =! Teun’;
*t sfoneporrt C5
}PBL> Delete fom, x where Crome = MiLLy? ;
Als Sovcopt ate ills :
S§L> QOLUBACK “To SAV EPOINT 5
166 Sick & Prom S amply
Scanned by TapScanner9, Data Contsel Lowguoge 4
a Gaant PTs stot murt 6 used to provid
+ the access peamessfon to aif peacut We bey
, (access Hw dutabase-
© Syntounr
is” GRANT SEEM ON TPBLE-NPME TO USER py,
Re a. Rooke > Ts ustatemunt vad to
e musim -
" ttake boot the fe pes
Sytons?
rae sttect oN TABLE_NAME FROM
USERNAME 4
1
goL> shew Ls:
Uses wy suott
86L7 GRANT AELECT oN EMP To HR;
Gromt Buccesspul ‘
| SBL > conn -
5 Evita Wer-moune THA
ih - onto possroord bho ROR a
© Connutd «
i. BGL> Blow Ung
VE Use vw HR.
SQL> CONN
( tu WK _ name (6C0TT
wee 1 OR EG
| :
SGL>REVOKE SELECT ON UMP FROM Hp:
Lovke Successful. )
96 L7 LON,
—7
Scanned by TapScannerWag By Chua! ag
tous usec to Zeb he
Oader- By c
ecords ebtherre ascending % duacending orden
‘ut: Zuols te wrerores
- ay
ppc aera Hitt coun moke wre
edn we make Ute O, DESC ptoteinent
nto * ‘ |
“Galect ¢ [Column - wart fron Table nome
| ead oy. ran rar ( Asce! 2e5
1 Tented
gg Lrscued eee hee Boh As +
A du 9-|
gous acter Enrows Sal Tap om ove ord By a;
agin aula Eunp Au OY Pose 5 1”
alma 9, Shh
luster viv usecl to pepo colculation on cata
de tndlvtdugt lata tome sto maywptlate
to
ve mat iy vOROLLp ee ds & abso ft &
used bo ‘fownot date mumbo 40m .
Tips 9, Furndhions
1. t Row fumctim .
a. Tull; Rew fine [Group By- fpemetion/
Aqugat. fpmbon. |
Scanned by TapScanner= eo
aodry
pbuoy <
ryomay
wy doy pep
ysqny « any
pe) YMG S vaddy<
uumy ' @TAN my watgpunp “wap
bay Dt wf boys" el uncgayd miro mony) 4AhwWoG~y- —
nw
WOW 1
oe mpow~yy
7 ua gown, ro bby. . i
foyeump-hg -drang | m2 @ “voypims, may aybuns- Q
——
Scanned by TapScannerPr! Row Funcbiws _
[4 Sa Found om
et Cost Mani uladam Funcrons .?
ae os use to corel al the
: itn ivon Abing tnt o o Uppu che:
“Apis es : Hoa (utaeb! Column nowe)
SAL> SELECT unre (ato rea Duel ; |
ore
ga
Sg SELECT UPPER (Enomifiom Emp 5
UpperlEnratrns
SMITH
MILLER
2 Lown Fundion *
Tho fugit w wed to cerwatall te
Characters i von ae Vnto ox Lowecort -
lon, Low ( teva | eoluwn noun)
Ent Ly SELECT tower (* sat DoAL
Low
Sav
SEL ySELECT Lower (tnancyFsom EMP 4
lovoex # (Browne)
$ amit
fuer
‘Scanned by TapScanner» 3, Inikcop > This junds on wv GEN, ow aN
Pak as nto upper-case GE He8 OTH cose
, Pato lowerchat -
*yrtow 2 Dnt cop (titeols | column won)
1 En + SOL >Select initcop('S8L) ftom Dunc;
Wt
sql -
SAL SELECT ENPME, | NITCAP (e NPMED TRO tg
i ENAME inircaP(EnAme)
smite — Smith
‘ MLLER. Mitlr
: SQL> Selec urreR(‘ movnivg?) 1106 C Fyn ny
INI1C# p (HMORALING?) FyOM DONL;
Upp Lowee _-tNitenp
Morn InG mounting Morning
© (6) Chasadir Manipulation Juncim
i Neoake fchion I
“(Ths {undiaon ts used to aeplact “th, Aulostiing
_ From a iver Athi
‘a Suyuton Act Replace (Sting , subs to, nlew
k cel op > i aaleent ules)
1 SGL7 Beleck Replace (‘Toun? tT? from 8 wal 5
( blovo he |,
SQL> Belerct Replace ("6 Mevelope ”,c’, Tayo!)
| {Ly Tava, Develop .
SGry Seleek § Replace C-Tavo?,' x, 18?) fromm Qual;
b Tove: 7 ‘
9gL > Select Replore (1Towa ?s ba, in?) ‘from Bus!)
Jone i
Scanned by TapScannerPro G to adele
1 Olt the
ee Stile Le teint og sepa, Aol, fp Aplin ron
ain a quay f udkiove AU. flu emplrytes odin
Sigle SUE OT Replor cou 's'to'4”
gece Bere ; x gos ot ¥
race nome Tob ales’ p yet) from
select Rap cont Slat pl’ ,
a4 q?)4om EM PS,
fuk Raphsaces Enotes
a, bubcAb fumes
Thu Rates is used to Bend the sulsting
ci hones a ftom wibg to ag {d
, orn a cyon Gib
‘Tht entrachon
) The te
yy
ec ng. hosts Ig posi fi ovyiergt) :
Dovel *» VBSP)
ha sus. ( GSpiclxs 51 eer a or
Adu Brubste (Opi hor 9 lr 4
‘Belick sities 8 jcts' 8 , (oy 7
Aas abate (Gepicies 96) 4207
Bulk Ay bstt (Gispidis 9-800 ual 36
Dis louy ott the emplo ques nome aleng with
trot dipploxy first char & lost char froro
wow
{9 din fo ot Hut employers whos nant stort
Wh Ysitowt Using ake pesaker
(981 select tnomy ae (fname » \ 1 Yfrere C08
sth (Exiames-l a) from POPs
3 om
8 Suet ~Eromt y ieee Enounes\ »
| Betece & Foor EMP WHERE SUBETRCENANT | )
‘Scanned by TapScannerssh 7
adwepuic?,5 5 5) t50m Duns, (
Pp bitaenal Howlin
b - Reteek subs (Meh
LDEVAP. :
" Betuet auloite (Ma hadevapura’s-B,3)f90™ Dual, ;
5 DEY
fy Ait bi CM ahadwropusars 10910) For Ray,
wf BURA
ac Actuct Replace (‘Nigsan’,'s?,‘y?) 40m Runt ;
, &Niyyon- \
' ae plac CN Yosh?, in’, ‘Nis?) Lyero Duss;
by NisYash
f Select Replaw (4Euto?, 2, ty? )toem Duel ;
bEuwo.
Mutt -
ulti -R cup Bay Hunelatn/A yrcante unin,
J‘ bThts function operates on a set 5 Ae cowila
, Gnd wets Ent Kesults
(ask 9 quay te at lay the totoh Sabor
iglad dateny; Heat Selous cuang salonyg
Cental 9, several
i ggLy SELECT gr (SAL), ronx (SAL) smn (390),
| VG (SAL) » COUNT C#) FROM ENP 5
Mi sorecsad ngax(sad rain(sA nq Csni) coon,
( O95 5000 8o0 Tt, j
b Emp loyes who B ts ng comet
| D Display no *h
| GOL >SELECT CounT(A) FROM EMP WHERE
Comm vo NoT NOLL,
a
Scanned by TapScannerri highest 3
Fe alahan AAS Cened m
SEU cT MAX(S
Sar WHERE age Saeed ee oe
av ag{ Ut 40 % clerks op dept-do
5 SULECT COUNT CD) FROM, EMP WHERE
5 pe CURE ANP DUPT=Q0.
2 Display re total Slay im ceptac Lo
wo 7SeLeT sum (seb FRom EMP WHERE DEPT = lo |
| ppurptay oldest 4 Lotut ecard date dy EMP
ggi> SeLeeT rn HIRED ATE) sMAX (HIREDATE,
From EMP 3
ump loyes those who ax
® Otsplouy the 10> 4
fountng mere Tow 8000 -
) FROM EMP. WHERE
| agi> sebect Comat
SAL > R000 »
to count unique deptun. |
Owalite oo Query
COONT (distinc duptnd) Fo Emp 5 \
go> SELECT
tout (cidtinet dept 0)
3.
DistincT bade
konto exc ohich w
ae f 4 the AUS BD. |
5 Qistinck ts a chou
Inet to aewnove Atapls co.B* fu
Ex
STINT DE PNO FRO EMP 'y eT
2e
farrst stuect ®1
prstint DEPNO jos, FROM ame ‘y
Scanned by TapScannerSeep By Cow ey
fase } ct one 1d 1,
1 dat aos tia multiple accords & group the
sould by ove or more © :
t
» Ayptone ¢ 4
¢ Select Column _noune 5 Gsoup. By ‘funchien
Pro Tetle-noume ,
1 what
The cotuumn cohtch will be present do the
Belt stmt Abld be present? mM eps Clout al
iy eobigg douse & used to wesbic WEn- Groups
otto. & te allel be praenk before dtu Group’ bay
‘Claus 2
| % Howling chou 6 Used to Be ae gos
Sate. GF te alld Ge parent Of Fiortp-by
(Clouse a /
bwhne clus yhowing dou exc optional &
‘ak i Used only ere CRIM wndition
i b Oadias -2y chou sould be prucit loo
"ad te end Q, the Quo. ran
{ & WAG to displouy depart wise, Soha Bolouy)
| POL SELECT DEPTNOYM IN (SA FROM EMP
Group BY DEPT RO,
® KAGE +o uplay Tob wis total
S647 SELECT OB, Sum (SAC FROM EMP
GXoup BY sDB:
=
a
Scanned by TapScannerb abs deptwise no Oh Employees .
Fe ee ater NO, COUNT(#) FROM EMP
S617" By DEPTNO 5 Bah
| tie Jobwise hight Aoloay only i the lag
oo tan Ho" |
ttoy tee owerage olay J) OM oN Deplraty
oy fhe Maniwwwn Jalosy % cath ib. |
: awit Wighwst salosy only ff |
Out toy v med Hav I500 ai HO
| ihe ayo «Bent the foto, box on highest story
” i ae a yolich OF housing MI
Binloy We Sofa
| ghoun ow
6 a Tob, on (Sai) tro Emp whet Bal7é00 |
| gpeep by Tob’,
6), Adtect PepTro yhvug (200) feoro np Gidoup By
Dray ;
©. Adu Tob , mam (Saf) fxm Emp Crtoup By
Tob 5
© Souk deptne » Sexy co unt (*) fom on
Group By depino
how sir (dopt no) 7% >
G . Belk Tob mor (sal)
foom &m
whe deptnw | =20
gfroup by Tol-
| hawns wren (so! )> 1500
| Qydu"by mon(Sal Ase}
Scanned by TapScannermunimum nw
ae gisplay the Tol whose
21 WA
fo Qos than 1000: :
“1g wing 40 display the, dep
; i une montium Bal
ile mee fo OO j Nie rmanigs gaol
aC for the dept deparstrmert oh A
; 3000
, thon o equal to
HN
! i th Tob G no oho
4.WIDQ tO cis ploy A oh & *y Empogeus shoal
| aseiking for tH fo" tte Job thot
1B. WAG to diplay tHe daphao € there one ello
for He Dept vohose avg Aalouy is giealir Yan ty
b-WAQ to du Ahr seh & total Aaloau py He
i ¥ : SB
"Gob welest totok pelowy is -< hovo.
sf. HQ to dwploy tae Hephwo & there wininwl
j salyfor the dat whose mninwun Salery<4ov0
1 +
: fe iPS 40 displouy the Deptuo & nod Employus
{ teoaldng for Ft for Dephre bewenig~calory vohue
Vi. vt vovrsst mere thom S &mple uy
H Ca. nIRG to déploy Hit maimun -2clautor cach
iB aw fob Badu’ att thy Enplgee bee ae
¢ Ends oft ‘8
Sargelut IB, Mpx(sPLD
from Em
votre Enouncut Ike *%S?
Fieup by Tob 5
no thet contains
Ie
sitlinn
Scanned by TapScannerSelect Tob min (sai)
OM Sp
Hop bY Tob;
hawing ini (Sal) 25
5. sect Peptno , fg (20)
fom Envy
Geup by Fpino ,
Howirs, ows (su)? 000 ,,
§. Select Tob @ (Sat) ©. Sereek Deptno, coud}
UND
foom &mp
Foo Exnp Group by deptno
oe Tob howing coud (#) > 55
Howing cu) Lovo ;
4 Zoleck CEM, mi
oe ent 0, mvn( aol)
by Dept
tte mied fget) ust
————__
il
Scanned by TapScannerele ne
Sub A est
bP Guay within an another query & cated,
Sulo- queries
15 & t also volled & ie San ae
Ly hare othe Prnvy ql will be t
will pous tee tt to ceetput outa Quy, ~
Hum oubsr query actus the iva outp it
\ todo fom te tun gout quay we make WM.
r b s-aow Auly- qua
Ly Sirmle- tow SubQueties zrwehenuts 1 Sitbgut
hi at mys valu as a ‘ip to olites qua
ie ek to jon te too F outa quay °
Qe we make Wert 4°? bpeaters -
"Ls Muli -rew Aub oie whine “He SubQua
Lic meta than ort valtty a2 on/p 10
Vouk auay 4o in thed cos » fin dar Tana
E puto quay, que
| feyoh ued
Atos qa] Tinh
uty aid Guay
Bunton?
tly moke UH nob
yot
Belt #{ column Nowe «
efor TO nant
volun
6 whut ENAME =
bom EMP ip coming tov
sat
emment
eee “en nine "Rowen
‘it alt the earplos
BF aawt dept 9 a
ag.radea Oeptno fom Eup 4 ;
Sg Lr Aud F from Emp whut © ep
Centro foam Emp whue Enome =
5, List ol hu Ernplo yr? oho OAC
of puvvorle “tan veo i workin fot
List ott ths Ereplo
“alo é SE aoe lstpboxtrnert
eo
Ename = Anno
woz gue
teins? ) :
Located
ans
Scanned by TapScannereptactinunt ones rere aa NG)
polar Bali, |
in t-
Hh Bogry setret + tvor Erp whet Ben ed
/ CGelect Deptino trom Rept Ne foes
: ASGL> Select & trom gyrp whe Deptro
© [eel Deptro fram Dept here
Dnrowwe un [Aaty’, ‘aertorth >);
ie +) back name From Dept whe Pepto tn (Sleet |
Depino trom Zrnp HAT Lantigmons)s |
‘ $) Seumey tor 2 4
i PD Emp Whine SUL> (Seurt fy Eo!)
Bi From bap where Deno =30 foup by Pepiu);
ta) Select + Pron Emp mht Rept no tn (Sabet 4
i. Gepiro trom Degt whurr Loc Uke “/0%?»
Pale
[| FDtsploy all the, Employees Te woh Tol is soune
| {SGL? Select & from emp whey Tob w(seled’
Teb {pom emp hehe tram. 1N (eSeott? t RO
5
estan 4
Scanned by TapScannerd
et & from Emp whue
6 ee ee tel who jk Hl CSebect
| ‘Gk oe Pp what Ename = “Seott 5
1.5 Gelect Employee dletols who belongs t0 dept-no
at contours moac than 3 Employ ool ey
go 7 Suet & fom emp Whar Bertno Sn (Selec!
ting p wht prawn > 3)
ype play zmpto ditaih who %
arg fe Tob) walt brow osal los
Gai > Bolick + from Emp whi Toh (Set
JoB orm Emp pop by Tob towing mox (sal)
43000) 5
5) yuna +0 disptay employs? details who &
working ho Joh whose min Solo i > \wor
gL? Seba * tS Jobin (Select Tob
orn timp group by job {how Pq nin (gat) > 1008);
| f ho w get
£ JWG +0 dvplay ewe ditotils ; es
Arlasy mow thom total SOLOAY a Seltomouy,
Emp cohtar gol > (Sele Sen
hut Job= 6 £alusmom °)%
Employ? artodls who 4
piploy au th Emnplouces who & Reporting +o |
q
| os maonimum Sot -
ahi> Select pion EMP where Sol IN(Setet
mon( set) From ep) >
Scanned by TapScanner~
© mon (S05) pom Emp
sQynieg oul ru dept ae
» attrost ow Employee bop ae Dpto
gk Lys thom more 4
WAG val a
gins a Rom Emp w 3
gq >Atlik *
Fal Sod) fron Emp >
Hot O72 howing |
IN (Select io
coumt (Enon) 7 7
it ho na
Lol ping 1 cuplay cee “ig "Oe |
Emp what 20 < (sued
ae Vn ees Aeptno = ao)
oF ae ae qa0up honing
ve tno be ens €mmp pour hy
Al
Scanned by TapScannerFotns 4 a
Ziv out, vat to pit tte dala, ale
[ait TH Aifeent Hynes 4 Toh aad tl
Heconcston | aos |
|g dover | SCmple /Equye
5, Gate jetn :
: A outer few
cof ye outn jo
> Lull cate jon
My sah J Ww
\Coptestan / Gers Tein
aye? aera each & ery mcorids Tot tour
ce, mattis watt. exch & wey BC0v ontths
diadly Or A
a it wil olusploy the ofp od le well
ap nla Records -
bus Tit 6 os
THiS 30 HO tad record
a
A 51D Poa) (599) [po¥s) >$rualid
Bro \(8 0) C130) LPNS) rcceadls
(@,?°) B70) CEB) (c)40) j
' 0 tplay Emp nowt along with Hu dept noone
gr Solet Enoumt » noun from Emp Dept 5
Snovme | Orome
TeSinkth | Rocenich —
Allow h Reseach
Aol
op 2
volicl aecorcls
Prvalih secords .
Scanned by TapScannerfi OInnw Jovy _ eo yo
LU! Lo Tlheee fy cach § exery sueordls
f oe with cach 6 oveey aLentaly fn
table & HL wll dlpleny ihe Jp of matetag
| arcordy fea bof tables -
‘4 Buy wiayte>
fT Keck Tele 1 column , Table d calumny
# mm Eablet 5 toute &
where fovblu Common tolumn= Tabla. Common a
ot Ta BP Lota Emp nam along wi
e
t name.
: 5) cgl séeteet Frou Orcuns fom
5 mpy Dept whers Emp Leptno =
; Dept. Reptno 5
al Ge List th &mpNome che
Ty ASL fens Soran aly i
$hL> Sutecks crrd Mee thom Supe ;
ee Feb, loc Flom Emp t, Dept 0 |
aor » 8¢ln0= 9 Depeng ae ees .
Pb ploy Ewoune. 3985 Oname ne
Lt who axe het located at Ppuns i) the Solem
‘ SQL > Selueh Enount . Dna,
sa) Whur “£410 mo
» Job, Loc {tom tmp £, Dy
aunel fio = O- ope ee ;
oc Pe as? « 2 BS Tob = « 2alesmar
;
"| Bplay Exam, Tob, Sipe
—_
Scanned by TapScannerae
yo Bplay Exomt, Droume ry Ol tbe
a whore Wome Abt Votthy
‘toa tact Enowne, Snorne, fiom Emp E » Dept 0
Deptno= O-Beplnn AND Eman Whe o> »
pyr gt display nome, Sal , Prowse, 5) Ud ty
ply) who all Foaning Move thom miller 5
av? elect Enamt, Zl , Oname fon Emp = ,
SO puhae E-Keptno= DeDeptno hND-
Bl >(Beteet oat prom Emp wheag 404 = 'Mé Un 5
oj Hird ote »Pnonrs of
{IDG 10 cisplay Lnowne , Hird, t
2 ne Emploreces glo who howe lived before
ml gtlivedtalr » now fore Ennpt
Para D where Ee Reptno= 49 -chept 0 ene Hiredom
ome
| OF setuct Hevedate from tmp wheat EM
| 2(
| ceking?s
ar + tou Enome , Doplno Bas Loc 6%
ting +e et Sebo 8 eng
Bove +hom 9300
Bing to olisplay Ervoune » MQ? > drone vf
out emp wh hawt vq aeporbanoy mgr .
SQL> Acteet Enovne May, Oname fron Erp E
Dept D rhe E-Peptno- ©. Heptno ANP Mgy w
Nob mull 5
L
Scanned by TapScanner; (SOE Tews
!
Los el) fe
é
g
Cans]
(isieains |
elt Qutu Te LoL
Nhu. ™ os g Gary accoycls aL Ow
take is comporedt wal Ha bach & Seey derords
SA atl ad,
om both e
“eal fe tft taste MORN acco
nan (Osade ‘etet)
Beek
EEE tn
| Siays Tee ty. ce095
j S8L> Select Trane » Qname
oie emp oe
l os - tno = Dept. 0
| Ree Oster aoe boobs pt Septno(s) 5
. tahere in aaah & ener vrceovol a owe tolled
| Rey aecools another tati
t wo
b | & TU Cisflory the ould A matched wecotds
ay
«
) et th
. i ca & Unmatched kecetds omy
a
Scanned by TapScannerPou?
Bes alt Enome , Prout.
ee ee
fre
“Meptno(t)=-Depe. .
outta Torin > > Dept Kept;
wohue tr each & eu,
composed ott, rch & ovena scorns BOM, to
poldt & HE well chéiplouy she eretpe sD nrieus
gs well unmated Wecovely Laer Mebeled
Joa teh tes btom bots
unk (ANS, Bid)
ooo See oTa
) BuliT For Te
ow Ty eo tqecey } :
Quay +?
Atluk Enoune , Qromre
fiom exp yl outa jorn Dept
& Emp» opti = Dept. Deptno 5
“Tom 2%
Fiving a toble to The valle us elf Sn
Whee tm each & Every accords a one table is
tempored with toch & ey Atcorcls , SOrnt torte
ae Wi olisploy 4c op od MALE wLcerols fim
full
Pup eorticl
— Emp M9 oliag
4 Emp no | Enoune
fr aR A ou
or B oO}
Oo 03 ¢ oD
od o¥ p O3
Scanned by TapScanner» Guscy,’ na
He Soluk E Enoune employee Nowe 9%) -tome tay
om Up E» Emp 19 : “te
vohere E- =M- Ompno; :
Rownom 3
: Tin A te a vital column uit w ObStei»
} sith Me database tobh at the Bine % - i
tt Eemp. Column which bs query based G Sri A
: he Wurbroe, feom 1. Gear,
Runs do
BEL 7 Kuli Ename Revonum tom Emp 3
Ga > Ate Enome, Tob , Bown ftom Emp cohen
IQ > Lele » seem “Emp wher ;
SAL Lekeee 4 Cag aes ewnunn = | 5
ho not geet ca 3h
olweurs shoul both |. end
tele! Nosmaltzatton
| SE Ba database cestan ‘technique whch helps
|{ to aganize a tale
(Lyd devices Loage table Exto on gmalle tabu
1G Unk tham wing patmery key & ‘foretgn key
joe wos Prbpducd by Kolger Cra toho
1 Properea Hu, thorey Novmatizotim with He
|| Pndtoduchon 4 13F Amyat lorm & he confPnueedl i
enna Ha themy with mg 4 nip. Lote Me
Sond with Raymond F Boute Fogettev fhe
Enttooueed Bowes todd Neemot Foam (een
|
Scanned by TapScannerUcar Lebtney Oatorclar, 2°
suf fable Cloubte vofttrout Nye Autis)
Pe
t fost
KG F
ee
Bahuballt
Conjury
ade | Master
sins? istach cll ap, therabte Alda contain
A Yol
Ainge Lo gach wecordo ned e be ana
2 Hh NF %
Custom Sefer tent => (OE N
padaays | Cia Ranite d | Zorut outs
pe Fobbal | eee |
Patter |e
19-6 Rood "a Bahuballi
i emer ae
Mgr: Road Confury
Bakgad | Mastu Ms:
SNE IO oring #0
Gtr toll. os to bt, art NF ales
b Pakrwory kay & {os etgn kuy 0 to be provielee
{oo Hea Forts : Cia —finkona Reytrd Erg
(9 Noume [Address | Golutalir CTD | Cte Ruitecl
01 JOfngo. Hebbot | Ma- a ee
Od Bangi M -Cp Look (re or | Balke _
Wes [Oman : ov | Confury
M41 [Bai que \ Mt Flos Wout
‘Scanned by TapScanner—~
to He BNF ous,
Sd NE %
2
arte be acct
“Ly Tre table eounstBVe unctamal
oo ov"
bgt thero Or ak as to be wemtoved.
depencioney them
. Couto Sfp __ ovie Revtac S55 ute
"Jer [Nama [Adduss|s1| \CXD | move Renly. TerpTan
5 ol K-G-F_| | 400 [Ms
Oo! | Ofrgal Hebbal | 200 LEAF | oo [up
2a [Bingi [Mereoud] 100 | [Sa [Bohuballi| [S00 [Mar
Rings | Batgode 00 |donfury foes
d Master
id?
~MAG te alisplay art manimum sotory ($47).
Emp E, : Emp ka
ly Ie 2,
(| fry Eneme | ak BoP lenomel gat.
lor | A 85,000 aE &5,000
, joa B 30,000 | 0a B 30,000
I> [831 ¢ -> [Ho, 000 03 | ¢ 110000
ie] (0% D 20,000 on dD 0,000
os| 15, 000 05 E * |is,o0§
\SAL? SELECT Pisfinct E
1+SRL FROM EMp Ey
: OM EMP E
WHERE B=(Sevect count (@wrtne gg ine
Fhom EMP EX WHERE EQ+SHL>= E1+Sa) PE
= 1.
ne ‘ a
Scanned by TapScannerPrt 20190 -
6g Sl? \ €a-Sol> ze )-soqp en
9 PEAT O00 — Q5,000 >=
50 =30,000 x
2510.7 =89:000 I 39.000 > =30,000 -l
30 =Q 6000 jh
0.00 ~ 9G, 000X 40,000 > = 30,000 +
9007 = ke Qo, 00 0 >= 30,000
p.0007 TAP ® 119,000 > = 301000 %
1
fale abe d lownt = a .
“and to ts plow ava minthium 4olar
6g? Select Oishnet E, -Sal from Empey}
hore 3 =(Aelect count ( Ob nck ba sas) tron
Bmp Eg where €g- Sal <= tir sal);
ping to _olfs play top 3 Marts Aalassy
gar Aunt Obbnct E14 -Sol from emp Ey
phere 3> = (Sick Count (0 EK ree €2-Sai)
Emp £8 whit Eg-gal >= 817S0t)5
Ws to duplay top + minimum Solaray
SQL? Auluct Purinck ti Sal feom Simp
rhe A> = (-Seled count (Obbinct Ea-sal) fem
tmp Fa, where tg Sol <= dar) >
uath € 2% martini Zalerry
WAG to_attsplay fourth “1
SGL7 Select Ounct £\-Gal from Emp Ey nehow
He (Select Coot (Abbnet Z_-sol) from Emp Ea.
wheal Fg -sald& Ey-sal) OF gz (bet count
(Dirrnck Eg sal)fpom Emp ls w
Were Earsat >= Ess)
L
Scanned by TapScannereBoy 0)? ¥
function & uuatd tO Semove “THe Spe difted
Ths
chrasactar bem & given ABU
| The ci frent types Ob ob tatm
{ ebtat :
) &RTatm
' 3. Tat Fein
function aRL s
Shading
Both
Metadw func?
Ls This funchio wusid te aunove the Sped ied
‘chaaactus tem tie dett hand side qo given 4 fog
ae °? Tein ong DRA
Yxan ACES
SGL> elt LTatm( tsar? ,t6% pion Puols
SS aL :
|. SgEr Adect train (-QSpidears 23 °S@ 4am Duals |
spide |
_ SG u> Sueek Ltatm(' QSpideas” 34S P*) fem Dual 3
* Spiders -
; SOL> Seteet LTaim (+ QSpi cles? , ees) fiom Rua;
->G Spiders
, “eat > Buluck LTatm (MMMMMS",
ty fas
1 @L> Select LTavin( (MMA MMS? 4"? *) trom Balj
oh MMS
I Sets Selick LTstm (*MMMAMY 95
a2 WAU value
4p) em © wos
iar) from Seal,
{
|
a
Scanned by TapScannerrm Ne ae
( z
‘ qnchion Used
to “Yumow tu Specie
a
io as fom Hu ay ht hom pe >
eats 2 < : a a p
roe 1 Sbring 1 [Tawi sting) i"
ine * 4
seid prov’ pido, (R5°) From Dual 5295p ele
gL? it RTvim(*Q spices”, ¢ROS”) om Avals59Sptds
agp rset praim (5gspiderss’ G”) form Buel ; Siiplios
7 aN from Daal 3 A.
"1 ating
“ap 7 Beueck RTrim (ANN NINA’
Pfevin fumes mi?
Ayano?
AA ova Leading | Taiting | Both Taiim Atiig, 430m 4
4
1 ft?
ogi? Srkuck Taal Leodtig. E> tv EWeccome”) #0
pual 5 > WE LEME 1
pele Tavm( THONG €2 fem EWELcome?)
fre ual 9 =2 EWELCOM
3 7 Belek Tsim (Roth 6? frem EWELOME’) :
Hom Duol 5 =) WEL OMED
dt & Used tO MGC
Concats: fumetaon >
fhe literotls [ columns §
He voncate junction accepls only du two oarsmen
1 Poth. poxcuntes
cthom 8 04 Lumnents
Aebeét (on ost
by Sh we Want ty poss wey ee
Hun. we wud to wll o quay nustod fu,
trot russ O fue wiftuiv & cuothe pum.
Syston Comat string | Slring%)
Concat{ Conca (stving) bbing 3), Shing
Eni salut Conet6G U0" CLAS 3 )prom dual seeyet
(emmetine 9,'Toh”) from Gop .
Sect CO not(Eo neat (££ nove one Bepews)> gout
tiem Onup >
Scanned by TapScannerYous satay) SU)
Fay Seluet Concarlfgnme >
4“ Beam bap 5
dongth famscbion 2
aqua & ude fine tu. dength Mh a
‘ive Shing,
Suntan > ‘hength ( (tterad / Columns
He En aGelert longs ( *SgL’) fiom Bual 5 D3
Belek length (# SAL Class”) from Buc 5 => 4°
| Sefort Lung Hh ( mont 5
uluvk ome end 4 Concent 30m Smp
DOioplay clk +e Empleyers whose name is hows
muclly ve char cit vit itout using ke cpexaton |
dot y delet Ename tength (Erame) where
Snowe =5 ‘fromm emp >
“BaLy Auch ak from ump whue Longin (e )4
LTnsfypunclion $2 : |
' This tumctim uid to teada posit % a subhi
‘fiom & given bing bi Mm neumbea of the
I, OcCURCUVveL
sgh 19 Prat (bingy substi . strasting, Positim so
I Ent? i i: “ocehd
Select Prstk('6.S¢ PISSSDERSS?, #3?» I A)fsomduol 5 ¢
fi Aetr Druhh@ssPissspress > | ‘5 %4345f)fsom duel0
Arloct Jil (SSS P1SSSpeess , 56,658) 430m ducl4
; Seleet duals (1S SPISSSDEPSS, «go, -5 8) tom auiel)
(Belek Sula ssp isssneess 548°. 54-A\tom duct)
Exaee ecees
i
Scanned by TapScannerURN
» Mette fumetion3 0?
w sa) Wave Aydt foom duol 3
Ly Sysdole a ‘
162 Pe -al
| Sarr Select Current. date Pom dual 5 9
"i Ly Consent doite
Ib- APR- QI
“SQL >Setict_ Systimestamp from duo 5
Ly Systime Sta mp
; jy Pre 3 1]-05+ 10500 AM +05530
To-chax function Pf) 74
This fam ts used to convert the gion dots &nfo
prea charac format 4 |
eae etek uy Shean yd, “yyyy, on, bo) |
ie
| sR noc
QO Ib, .
($9 Ly bobvst To. chax(*4tiriclock, Mm YY, DB
+ from tmp 5 af
: Sxtevelote © Oisploy onles Hie year from fe
hivedate.
1) by 26 > belek To_chos(* Hinclate? styyyy?) fiom
\, © {OLQUplay only {hs month “rom the bixetat
| |SQL> Aclect To chad (* Het ecfete? 46 Md") om Emp}
DD ploy oll te Employers eho axe Fahri énibey
% 81
Scanned by TapScanner———
4 : som
Ye 7 et Bx Employer whit To.chas (Hiredate,
wyed! 79
itp ait He Emp tose voho 04 foinsd in He
rn ae ‘
ne dae & From Employes ohare To chau ( Haves,
mz theb?) >
ptspla OU tue Enap Hinge win’ howe joind
| athe pourth enorelle op tHe ‘year:
agh> elect a Prom Employtt When To-chacalhaedat,
| MM =04)3
|acglay at! te Grp See
[Nigned ths Sone eee
| she ited er
Fm aa tet r?)= Cate *
qp_choa (pltredats YY som tie
hue Brome = AL” 5
@To-clote_funetion *?
This fun & useck ro convert olote feom casa
- du yormot +0 cxiqina dots former"
tr?
SG. 7 Seek To_date(*a0a! [10 104” 5
fom cla 5
“TO- Aps- &b
6g L> But To- clecte CAPR -Ai0 BI 16?
au 5
To- date
\e-Apv- BI
ryyyy Imm}po")
vim vy vB
Scanned by TapScanner), Gamal ae Bla
Thts “Tey Jaunclion 6
- wat Valuts °
i rf{Natr Vols Locate)
ih => Nb (Agi sg)
Bat Bs sia aud hen suas P93
as Pxgl not mull then Le atunn’
Sau Aeael Nvi(ta''B )ftom Huot — Ls ACaPh,
SBL> Selec NvL(* ! 3B) from Dual lb B Guth
(ONvha >
Bunton +> NVLAl Ayg LAyGa , Axg3
ale Pag! w% nal viladubes 1?
itt frqd & not “null sTt ete axes
Sg feleet NvLa(A' B.C) fiom Dual Ly Bit
— SL phetect NuLalta?.Bi'c') fiom Dual b 6 (muy)
i O'WAQ to altsplay oll He Employes Hose ooho axe
[ ting He cewunbssio increase Hurt vevwwissioy
Rs. 500. The Employes whesx urlo age rot getty
‘ lemmission give be boo
| eg yfeteck safe opetaien es ths
‘i SQL> Selock NVL (Comm+t 500 , 206) fo0™m Simp 5
‘| 89L> Seteel Nv&a(cemm , commy5o0 o6)fA0m Enips
\
Used fo cowest rally
a
—
Scanned by TapScannerpsnis Bub Quesys
[Al Out rare
it cote Rit ii ‘ sab quesivs
piel Ch & exo outy gueays ou f, '
tan aun apn at eotdy ap ohhe wlu-clepenelent
1p Thay ewe Eon thy teculed Gerery ithe euctere
GTB SU8-Querys Prreiple o bot
pals q YS Uses top peor a need pe
H sttaans Aur g CHL nal Guisls
pe aduans tru 4) Sub-qu ,
Wn ut Ae Ceher qual if iit Olena vata
Not- Exists s> Ploy Ma
SH actus Rue? :
ofall, ty Ht astute a fab funy dius ne ee
BU és
he ne a “ eeey wl U display
hs
aCe and
ss
: 8 aad
Sypdane 2 Set Tr Colunn
som Ti
rahine Entsts [Alot Eniste (Select 7 cla
trom Ta
cohere
TreCC=Tg:¢e)3
OVisplooy alept nove which & howing ae
ore Lp in ib
Sgpseleet Dvawe
trom Bert Emp no
LWOhtRL btsts( Boleck Ramcserdes
aa “Bebe -Deptno= Emp-Pept no);
OPwplay dipt pount whist @ not Lown Emp tt»
Sle Drone FON Dept whe Not Sytals (Select mph
from Srp _whiar Der’ sPaptno = Emp Oeptrys
Scanned by TapScanner‘RESUME POINTS: