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

SQL - From Functions

Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
43 views

SQL - From Functions

Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 50
—rheve Be 2 tePes A. Singie Too Sulp- ULery Qe mulks YO Suo- mere JZ. SAGE WOO Subbeucery a su werd vohicn yekung ErACkly one ol? ts KNOWN Og Single. you Suro ALLE Ty, wr CAN USS OPATALKS Quon aglEN , HOTTY, ALL Muy: Sa WWAGTD Emamey EAXMING mnoiethag Aton Sore? SELECT EQame FROM EMP oh > WHERE ERS . (Qevect SAL FROM EMP WHERE EName = saahiowd); LIP 2000, Ringle ote, woke aL the gubdutves Wintel We Slovedt Het noele ae Lhe Sxaraples of Single wo ubautres « Q- MK RoW qubanory: &é& Suvarery uae WAKA Moreton one cuckRut tg moounay erudt woud SH WEY: se must Ube oRexators Such 04 ENG WotT es! ALL Avy! LAGTD EMame who Ae Cortary Way any OF he ghesmay SEvecr ename puke“) FROM EM? : . owert | woweRe SAL Y SELECT SAU ay ROM ENP 4 HERE EaaeaJog > Walley man! © scanned with OKEN Scanner A ELANOS OVE Mow) Oho Oy | Hervey, Slagie Ye" et a oe WS Provieny Sve acat ago ALL any Perens ‘ fiw vesolVe AL OFEVALOH, AW operator IS ASPecial OPercrtoy GAMKEH CO ACCOR MUI PK at Rus: values i eetarn “treca OTHY Halt the CONAN Ob Mo RUE Ty Te wit Satis fed. Sy ear ' ‘ cotumna name [2xPreion Relational WP. ALLOY, «Vay, . 4 AY OPES phat pee eal Any operator § a SPecial oferatoR Loch Can accept Mullion Value, at RUS. Tt votty vetera ue <© ap ‘any on of tho Condition at the Rusis Sausted. Suton. Relartonal op. PHY Vy \Vr-- vo); BOLE MND NAME fexerersion BwaAsrp Name Of the Employees earning Salary Penn the Salesman. chad att “S'tLECT ename 7 FRom Emp / MOWERS SALD Any (Sevecr Sau . FRom €meP WOMERE BOR sigaley on! J 7 ~ © scanned with OKEN Scanner - LVAGTD Hekatls Of the Sopoyeos Weed altoy om she cers. SELect ® FROM EMP WHERE Hira date SAW CQELect hire dete Promeme WHERE os ctore))} Re WAGTD Nana and gal “for ait the empoyers tk they he ZOKM AT yen “Khan akoast, RANAAA. SELECT EMame pGP SAL FRow EMP were SAL (SELECT SAL FROM EMP WHERE BBs Manges Jy » Me WAQTD NAmMe ANd Wiredake of Emprouees hired belt AN AHS MONOAAL, Select EName, hive dore FROM EMP were tHieadate < Mr (SELES Bihre date FRom En? VMERE JoORB=* Menage '} 5 F WAGTD Nomnes Of tre Eraptovees eed alley alithe Manages and earning saloy more than Aho clerk. SELECT Cname From ene WHERE BITS i aa $$ © scanned with OKEN Scanner X WAGIP details Of the EsmpPlosers wooing 64, den and hired before Obert daberman. 4 * N wAgrp Setarls Of Empioyees LOOM OY I Accounding ov Sakes dees ty lela | / © scanned with OKEN Scanner Nested Sun auouy VOD ODL ONIIS 4 an OOO “Nase amy » A Sub 995004 ustihen incide HONG, y 4 Ps Known 9% Keyed Mul UIO"4s 4 ‘ % WR Con Neg Abush 244 Ai Wad , ood tO ie to find ath oy oat “U2 ® od i wore | H-L) Seba ir (n-.) subquires, { wot ie | cme S41 WoAQIO 2A coo 9054 3 “$00 — SELect MAZCSAL) sw : 400 ERom EMP 7 So woewe CAL Sleececr mme(SAL) ne fo FRO CMe 900 wo 2008 i Z . 1 _ & Sh) 5 MALL y00 Gooreov =( 5002400 ALOE we Gow he 922) too 1.400 2002. WH © Rov emg) coe 4,00 240 20014 ES 4 ayn 4o0 £400 RE 100.4 : 2004 490) earn wha aM rin col, Sete, MINCALD EROM EVO 299 LE RE SAL > SELECS WAT O(SAL) 2 FROM EMP YVMERE SALY 3 SELECT ME PEGA) FQom EME 100 wi ERE SALY SeLEC MI F Rom eng): HERE © scanned with OKEN Scanner WRT BE MBH nim, Solos, 4 SELECT MO GAL) FROM ENP WOWERE CAL BE SELET MOXCSAL) FROM EMP VOWERE SALE Seleck MatC(AL) ERom EMP WOWERE SALZ celoue orca ECUB) From EMP; SEheRE SAL AGTH WHAM OF the evn Brd MOK MUM Sabloay . SELECT SQowne , MarcgAr) FROM EP PLOY ee earn} ng WHERE SAL < gecegy MAXGAL) FRom emp j . WHERE SAL gevect ENoMe,MOLCEAL) ERomM Emp: WEED EARdo oF He EmMPloyer earning And mMarimeny sabodyy. SELECr MaxCAL) FROM EMP : VUOMERE SALE SELECT Empoo y MANGAL) FROM EMP 5 USE © scanned with OKEN Scanner ig UO ee Aes Ban mya axl a ye WABTD, Aetadls of aw the employee Who was red and HY wAGTO Kame of Me SMProuce “ Hred before she lat temployer . HWAGTD hoc OF thea amptoyee LOhO Way hived fret © scanned with OKEN Scanner Tenprogyed > MANA {eq velalion cee syne ds te Red menage? | Soo ename MOAR a Q Ai WATS ot! Three of A, 6 a SELE CK ENAIMNG ee B | ERom EMR 2 3 7 WHERE EMP = SELECT Mug | » From sme aon ase MERE Erernes hut SKS Behl sextet Resuce—coreamng Oeste —Palseentanaryg—EaL-O RWAQTD MER Name alk Blaxe from Le *Qo1e SELECT Ename from EMP Whee EMPNO = SELECT MOR FRom EMP WHERE Ename=:* Blakel, 5 WAGTD dekaile of President? MANGA Fem Coup ® Setect ¥ FRomp EMP WHERE EMP AD = SELECT M&R peasant So Rom EMP WHERE TOR = president’ | © scanned with OKEN Scanner 4 AWD Aepartanc en Hage OL james MasNay eG SELECT DEPTNAME FROM HRpy WHERE PEPTPO = (GELEC pele HEPTNO EQom EME AMER E-EMOMNG® reeetrent)* WHERE EMPNO = SELECT MOR FROM EMP WHERE Eracia= ‘yuna! % WAGTO tocatton OF — AF MANY, Sever boc FROM DEPT ; c conene BWo = SELET wee DEPTND FROM EMC LONERE Dewstetera! EMP =SEECT MAR From EMP Wt ERE TOR = i ‘clerk! > she of Serre Manager's manage. x wWAgTD deco sevect * FROM eEmMe WHERE EMRMOT SELECT MOR Ww FRom EMP Erapne, LOMERS -EMEMEO SEER -(GELET MAR FROME NP WHERE \ ') Emames tomttat J © scanned with OKEN Scanner © scanned with OKEN Scanner RwAgrp Wweakion Name of Kamei Managers y Geist, (oc FROM DEPT WHERE BNOt RAST SEN MATIN Takre yy May SELECT MOR DEPTVD ERom ENO LORERE Caesne— Shea . Seq Pnd ~ SQLeq Mag & F Row ep OWERE Ig, w a SMPao= SErecy Man FRon Rep CONERE Cneng: VV gegt « ) © scanned with OKEN Scanner dle aio Wasaury. 7% aeois) *M foron Uy: Susaned 44 Ssoq 0m th Zz own} M4 F _7sandwna oy. SAMdUE Sno oy saa Lau, AIM F ayo wWOZ WHF 3 wy mos avbuss Foopery Mod albus xa “ aAmduy ¥*O¥ ur 5 AGOUA ANY FRDIKS aancen coray Ra 0’ pymart? =SLOWW ae” — SAOEDNAS mod TON (C395) VOPOOTY “YaRPEny nod DELIS ayotnbeep eons moro say oy 2k PHO VON. suoNMAVeE © 2 OMIYAA 1oG saya /ALISG\ SY O11. 9 AoOA MW BOY WARY Sy on 1aae noon © @ scanned with OKEN Scanner Faye day Y38WON BVH YD Ay yHD WH 31, "W2\Gard SD) opp burmromnay OY Wo 404 Pam rq LX) SLOWUN, OIATW pow (rx; -¢ am "POWAATZ 20 BWHU WNIT) sy FOU SewrBae Buss v Rive adaoa0 USD SLoMaUNy merous “V i a (FOO. _Ousood oa Cyany Cawas -@ OS™ -% oyrn “SLoPuns Vyobebbo] dno3] Suoppuny Coapan fo 15TY - Ad | sya Gowruny. POX wir sYSMO BES So»vvar MazAynUs oF SAMA} YOAV WV SSog BH AL ( sydyno Ba KLYOAIVAR RAV oy : Ck “Yay Seebastpo e2u0 VO yWduy, Oy WH Say VE SayooD4a AL Am awh arbbw gran Ray 098 SVOWIONY . mor SHOW 4 oO syoprery 8 , NAAN XA SONS Yayeny MY WOW “Hauny sna Po vx @ scanned with OKEN Scanner 7 {avaprsard = 1 Gon Bastien SW? OAS orien aa, Wop fons Warne rahovgure aur oy VEN Yegoges sen woyy UBY (0 T wow tayo5, = BOLL 3434 “HA viens ir CAYS WOES 193939 ORO, AWNB BUR IT routes 2u3 WO 20} Pod oF poay Proyos yoroy Giusy" G Sawa v4905 Cysts LZ 190% Bows oy. vor Prop, ei o1b4 © : % Wear N vn DQ pps @ Na “Tea 3 Ars pny iyrs OY ts 6 wn : AEB OBIS! OME "* _ Bal9 248 Wg : A Cravasyr 75) bare ie Comenovee, AVS) FOO v wanrzia uy C) ¥ C2wond) Nos & ; * yueutpo Vo TO ky a 103, up2 on Yrvan oy Fra Pwr Cus D4 CV WOO? -Arwy Parys GE SVPWVN™ ASO Gro BW VAD Bue Ben 99089 12 F034 UE Sun Morpymvs Fn WUT? ? } orHGEH Wr wv 0 4, "UY 2 Ihion SUDRDUDY ONO ‘ ro UW ‘Waurlgrg voto ? "7 WORM 6 au an (WH @ scanned with OKEN Scanner WAGTD — No-ot EMPlogyeos BIOTHIO EAE ] SeLECY Couns 4) FRom EMP WHERE “WoR! HAANAGEA! WARIO poof EmMPlodeey TOE WOFKNE oy 0. Sher cen, KOA YS: ond med Ae worming In depeno: to and gF Ahey ae HO Arunrag HAY _COMeNiAAon. SELECT count C*) FROM EMP WHERE Not Tn CSaresmananoty ce) AN BEFTING ~ |, Avo Comm TS NOU) sp wWAETD = Metimum Salarg minicuen * omentrAion berg. ou otal Salary meed to Poy for au the Sermon ta Deron ond they ase Hivad during the 4eaK ko: SELECT MAX(SALY, WE WLComm) , SOMCSAL) FRom EMP WHERE TOB= 'Galegman’ ANH Deprvo=o} Avd : : , BIE DATES en BETWEEN APTa0-(6 . 1 } Ano “Bradt Pec~ ae, Prackt¢e FX WAG WO: ot ea es Rersog SALary lexgthan 2000 34 depens to, Servect CounT (SAL) FROM EMP ca WRERE SAL ZrO AND PERIWO=1°S © scanned with OKEN Scanner | ed cue s ELECT SUMESALS FROM Emme WHERE TB sherk! sagy> AVY Selon yy Noececk to YoY ANN Fw Cloqer * SELECT ANG CSAL) FROM EMP Y wrt \Agtd Kool Emprwyces Roving tA ay theie Hens a marearckes + cHAPNN SELECT. COUNT CK) FRom ENP WHERE EName hike ‘het wOOeKAQ, cu Z clerk Of Manages 1 ast woof Employees * SELECT COUNTLX) FROM EMP ‘ wotiere TR twlcler! ge wav nceal J; 4 Wk GTO oral Salary needed to Ray employees iced in Fee ‘CeLtecr SOMCSAL) FROM EMP LEK WHERE WIRE DATE pesrees Yo *pentye . Furgtp Wook Seaployees veportiag to LE IACMOR) any SEelecy Cunt C4) From EMP reetee Mans 483%) Pe ears ete ee ARNO Bo. SELECT Count C*) FRom EME ‘ WHERE COMM TENOT NOLL ANE DEPINO=Z0} © scanned with OKEN Scanner SRWAQTKD AVASAL WSLAL SAL , WO ok EMCS BOd Morse, Wong GAL, Aiving to EMOLOSeeS working OF Preri dons SELECT AVECSALD, HERA SUMCQALD, COUNT DMs . MAL), FROM “EMP WHERE TB> President’; x wAgTD Werok EMPogers Moving “KR Ae Ahein mame, SELECT COUNT) FROM EMP WHERE EWAME KEKE TN ely & EeARWYey and +oral Salasiy Needed to & Congrcabive US ing, ee isnot | Ray the Eeretoyees OHO Nove Na mes * sevect on SomesaL) FRoM ENP ~ WHERE ewAmE HWE "LEN! por of Employees Working In depeio SM wAgTd Sevect COUNT) FROM EMP WHERE BEPTNO= lO, se, WABTD No of Emproses Cantuel AN Sine SELECT cou NT cK) FRom Ene LOHERE DEPTNO = 30; © scanned with OKEN Scanner ( Fu ol 8S ducaray sobre Ane ToGUlt OF AY Mmoathercatical OPemuans done. ov | go prior oval gerscnsse of ON ee om OpexNod + ° a 7 operantod - eax U— Ol” Sevect at? 4 gue a Fama DUAL, | eer Bice Row runction Dawn NSN eee 04 Lanckon S Used AO Convert Ane Fiven WwrYro 4 4ko CRRA CUE + \cuntax VPPEX CUsenog') Pore sevect © upper U tndta'd FRom Bval’ oe pork she Fiver loner) £ This Lunckon ts used +0 convert Gives MWorree Sag Soe dower Sting’) AAR Ee: SELECR PowERC*IWOTA) FRom OAL F ANto Lower Care. Ae India. © scanned with OKEN Scanner Tarte ae) ween Orr sis Tuncton %& usec to convert the FALRAL Charccke Aol ( he Given SHINY Ato CPEL Cage. Syoracs INTVCAP ( ‘seine ) | Ge SELECT TwIrcar C india’ p fe Serre ul Ney FROM DUAL, 1) OP Wadia Is MY Country . Lennar) : mann sais funckto js Wied 40 cOUNt the Novok Characters the, Gre Present ea “Khe Strin, Syatar: LENGTH CSTRTWA) eas | SeCecy Lene © ‘Tadiat) FROM DUAL y OR: Le Proce WAGTD NOL —chays Ename, Who ade having only 9 Chowackey ta Mnely ame. 5 SELEY Edame FROM eyap MERE KENGAW LC ERame)= 5 5 >| © scanned with OKEN Scanner Eqgame — WWW Sele of a the CHOCO CC cee, PP oA greP ae Getting » OPE FALOKS » using gingle oO functions. 3 Algit Salary valng serect ENAME, SAL FROM /EMP woneRe, SAL Hike *—~-' 5 ox WHERE peENaTe LSAL) =p, agri | enome and commigson of ail"the Employee wl SUNG he qering 3B Ag ceLect ENAMe, Comm ze Comet Mon , ERom EMP WHERE LeparnC Om) =3 5 rt REeVERSEL) Ree hig fancrion te Used 10 Feveige he Avon Sting a Veyntax © Reverse CY STRING) ex SELECT ‘Reverse (' Tce CREAM) FROM DUAL. WP wAcec ECT © scanned with OKEN Scanner ony Soka Db aN the Ft sruste (A HIPPOPOTAMUS, tp, VS) > O " Twere CE UTPPOPOTAMUS “FT 3, 2)72° ) Te ARE TAT RPOPOTANLS PE, 42) “oO Bw sve CS WTRRORaTAMES “T° 1)——* DS W!KCWIANE 25 . tr 4g ok We AN STR UERTRRORO MMU ELVIS G oem (key Charace ASK occuionng, & Preaent ro ' he me NOK it lnenenae an © scanned with OKEN Scanner 7 cL paste Ast harp LT Seow tng q Aamo t, Vo Maine one e, geLect LOWER (SuastR Lewane Sevens, lon ‘ ; " ond and abl sof -the © ly PEVERSE CSIR STR LEWAME, Levee Lay Suacdion 4s wyod to cblain Tadey volte of the. Sutetng me ig Preset ta the original Steogy wht ¢ Ander Vode ~ Position of Chardcheg Syote mae ORTH INAL—ST TUneh-.0 ccurance )) woof dones ft ts Present: ‘ RIVE, SuB_STR’, "Postion, ath ocurrance — v TEV !WHL COL . Sy WEAR HHH POTANETY OY UY 3 So +t WSR 'CLATREO POTAMYS, 0", 1, 2) ; acta (A HIPPO POT Amys tp V5) 7 oe Sosy 2)> Aware Ct WTRPOPOTAMUS | “T | 3,2) oO Tene WT RROPOTAMUS ," PRY, ‘2 2 SOCOM By Bw eC WHRRRE TANS 'D" | y— nee tee | a. elegans Ty Egy ete e ese cet se tt ASK eccaiang, . YOR Preont %O ¥y A ; A hes, MOA Preseau sO + . : = © scanned with OKEN Scanner Praarce manga Aeeens OF Ane EHH gE the FEAPNBYCE NOIene atteast one SA! SELECUR FRom EM wwnewe AVSVe Cename, N,V )YO4 ) . axails of the ctovee % : BW wargrp erally of . Emetoyor th Une Ernptoyeo "Gtnp Porntatag — SHACK ONE "A. Sevecry X FROM EM? , WRERE TNSTRE ename, tA, \)ro @wagrp detais o& Ake EMP HH the EME name a catarmum RASS, SSLEect*® EROM & we - GomeRE TN STRLESAMS *R, 2) 7O; Mop UL) ANN ; THis funckon Us Used to OWN) Medes of the Given AQMbErS CReminde). Sq meal Se mod LM) © scanned with OKEN Scanner ~ sar? Aclans wl the emP Udnose EmPno WS oven 4 , sen nes SELECN x | FROM emMPp | wowere MOOLEMP Ne, ayo iD CHARC ) (Oo . ae ' inks Sanction % Used to convert the Jivea doxe. to ing, format: syitak og CHARMER (pare, «gga mnat. Movers’ ) FORMAT Modes owe SPAY \uy Ss - Ye ee +) DY & ee By ww D , tu MONTH yw) wa2Y 5 MM ww) HAA Mow 12) Mo @ wagrd details of an Eenptoyes Uf the Employer Nlredl on oec: SELECT * FRom EMR . iS WHERE so CHAR CINEeAAKE , MON) = dec; © scanned with OKEN Scanner ss iy 2) WAQTD Aotalls of AN FmCloyer udou ae Newod 4, he Yoak BN asad Shagte row function. Stvect * FROM EMP WHERE TCH ARE HERE PAT eV EW »S pea Names, Iieedate of an Employee the conty, hired on Feb, nov, ee ecwame, NIREDATE Seve FROM EMP Lon ERE “TCHAR CHTREPATE, “won! TW (Fee oy, ‘Ded, i . eo AQTD Aerails of ON employee who ce Wired on 2g, + oo geLect * Py FRom EMP ‘ woncRe TOCHAR (HaReDare, “Dot ) Tn 22)145 5) WAGE details of “the Employee TH the Employee parma Stare WI SA' atnd © they ode. Hired OF Gourde Firdo friday | Sundoy exsing SRF y SELECT & FRom EMP WHE RE ATO-CHARC HIREPATE , ‘pay) IN SOBAR Eran) AAR BSETOROAY “ERToAY! somDAT) ; a © scanned with OKEN Scanner name's of tho SPs ening + Vevod t ano edt enonth feb using SRF seen Ename FRom EMP YWERE WO- CUARC Hivedate, ‘ mon!) = Feb s L ENAME'S of the SE AOMoyes VINO Wee hiced in tho sAQTD pe aah OCT WON DES of select ENAME ero EMP wRERE O_CHAR Laite of the Eenployes 82-0" iced on wae Issey y tenes cuwedare, | mow) TN Ov, ov? ‘Dex © ys WASTE a fn wepnesoay OR MONOAY SELECT * FROM EME T VESPAY, LANERE “TOLCHAR Chine date) BAY") Tne POSSE ‘MONDAY! 4 as AOTD derails of the Eenployees Reed In che yYoesy %1\, 83, 8% Cetect * FROM EMP WHERE TO-CHARC Miredate, 'YY) TEM, 3,04} - Y WASTO Derails ok EME'S Mixed 09 ASS Loy, Bow arnad. SELECT K EROM ENP a LOMERE “TO-CHAR CHM vedate BPD Ty OH, 4 Iey | ba ”| a Scanned with OKEN Scanner WIN SYSHATE awe ’ ~prs Ts Uded obLaty the Praont dake. ear SELECT SISPATE FROM POAL) CW deebo Db- Aug 22. Ww S¥sparve] CORRENL DATE: As Command 4S uredl to obtain the Current date 4. database: SELECT Current PATE FROM BLAL Op VE~AYG-23- 2) S¥STIME STAMP hic" Command’ '% Used *0 OpEain tHe date and time Along with Amerone- SELECT Ygtame STAMP FROM DBLALY OUP ae Avg-23 ol 14-56, 2 000 Py + 05220 (3) DATE C) seca Laae : This fanekion % used to COnVRYE. the date Swing, te dake Loxmnoar + Syntak 2 DATE CIDATE_ Gye") © scanned with OKEN Scanner oe Cy te 4 Veadopencdonce Oe ou CHARCAO— pare Cb mg dae Je FROM DLOAL, mvt) TS yawe hoatc) ) vgauet 1 NUE CARES, peor) Ss ' 7 : Cn alia econ Accert _ GItte A COLUM Nome OF ELPEAIO| Hak x sy AREA OZ Mug Ah + can be . axgr oe CHUB UHEES Vote that Con be Subsritated IN To lace oF MAE ¢ 7 Present 3 ame value, at I4 Sq Noe NAM ~NVE REG TE orga ELECT SAE COMM — FRowm ENP 5 oy to — pore HO OvEA Come -KHig, ST) a __d SELECT SALT NVEC comnag o) FRomMeme? / ow yo 00 320- © scanned with OKEN Scanner iH) Ro Place this function ‘6 uged to TePlace tHe SUbString, way, Hew StIAA — Aa Yvea OVA Aa Serine , Syn tar Reptace CONR aah ESwri 4" CUB. Shei og Proves @ scanned with OKEN Scanner Sie’) © S€vecr REPLACE CIsprvERsS Tg! ) FRom @ DUALS SP gspiders ® serecr RECLACE C'IWOT A INO ) From BYVAL OR TA 4 YwAGTD AMAR caer Slory Feo Arnployee 4b SELECT MAKCSAL) . FRom Exp, 3p WAGTD MAK MUM _ Dory Pn to tne. ronangs From EOP ADIe. Select MARCSAL) FRom Emo VOMERE R= SManagesl . Ae “As LAGI PHM UG Soke — Lyon te PINP\OUC ot cle pt tc 5 ach, MY Seteey MAE (SAL), De PENG FROM Emp Rove BY DENT Wo 5 ww een grour by cleuse AO YOUR att the sotoed 5. ye by FH encecuees YOU Yq Vou: gor Group dy clauye we Cag Fass ColuMarEmY OF ou ’ capression — 4 ON argument. 5 wo Ca CONES Group by EAPremion along with roury ' yw Sanction iw Sereck Charge. 4 ox OK whtoh Grouk oy Extreuion 5 t~ Any gotuern ene. or SV Seon Www : Sec udieten Ea Woukoy clase 7% Krow % reaR dy _ ELPTEMOD - sAgee, the PEN of qoupry Cisse Ye creates Groups E and TH any classe eeceeates Ofte Group PY clowte ercecukes Qroup SY Yroup. « SELECT your by_ eatression [ Group. Senetion | | Vom TABLE _NWAME lemere Zernees,_ conditions] Grow Must gt bY columa_ nome lexgrearion i] © scanned with OKEN Scanner = wrydey of excocat wees orn * WADA AN \ [Onin Quo 4. a; devin, 2.6 @ scanned with OKEN Scanner FROM were Chased) Row by Pow ]% leauene 50 Z_ Group by C Rew by Pow) ‘wse] O00 : V| Way Ur SELECT CQvoup by Grout) < , ae ou SELECT MAYSAL) , BELLO te WAGTO mor wl Bven 10 Mhe SsnQusee tn foe, Ace Rom oN ; wore Y WoU> Sy pros on i vy OE ve, "dl degrne: 20 Aeprne: 30 depen. io Re rand i we] S. Fengne:| name] cai [dere | co 2 = fescod ol 2» | @ 40 cach job: SELEcY SOMCSAL) FROM EMP Gyoue by yobs, @ wag oo. Bow depahiment. SELECT COUNT) FRom Emp WUERE TORS \enanage,,? _ Brno wo rset Novel sal] Fee oooo| 204 FD wAGTS ~Ttal Salory need to Pax for att the ened | oF Emploqce worrlag ag a menage @ scanned with OKEN Scanner -“ angrd holo Saal ig naed 40 ray : ~ 2 Ww . J Le. anapyp, 7 iy ea - P we CLOT. and tf PY tho Qenriny ae . ft) each Ac hart Ment cov oe SELECT SOMC SAL) FROM EMP WHERE BOB ANCOMYS eloret) Awe SALY 1200 Group by DEPTWO; ary total Salary need & kay % y wastd Avg Salary, tf 14 or Mahe employee OM Eenployee Lab. SELECT AVY CSAL), SUN(g AL) FRom EMPy ) wastd Qorof TnPlLoyees worwing im Lach depeslime nic excert Pres dent: / SELECT COUNT % FROM EMP /* GoweRe TOR \= President? Group PY ere ¢) WAT ong, Salary “Need to Poy Sov att the EmPwYCE 4a Coch depast ment excluding “the Emploders of Depeno20 sevecr Av4(SAL) FRom EMP WHERE DBEPTNO | =20 GrouP by KEPT WO, H WAST Novo EMPloyae Having the Chagactey “A! tthdy Nome in Loe Solo. SELECT COUNTCRK) FRom EMP WHERE Ename MKe We de Gy by . C4 PY Tob; G WAG Woes |SHaployees aind torah @olary 4 att the Satermnag ta each do kd Ltn orr- eH fy eELEcH Coomlx) , SOMCSAL) FRom EMP WHERE WOR= ‘Salesman! QrouPby PEPTWO, @ ward psorof Employes orig 4 Each depart, “ee they ae qerkag Salary Moretharn A000. SELECT COUNTLX) FRomM EMP WHERE SAL> 2000 tavoup by PERTNC, : BW waar mamimum Salary Avan We SmPlosee Wf sys, age qeetag rrakimum gala, Move than 500 89 cach dope? SELECT MAKCSAL) FROM EMP 1 Crone. oY BERT WO BONING MAXISAL)> 00 7 ‘ HAVING, Clause CARRERA ge WO Ue NOViNG Clause to flee} the Groups. 4 WE CaN Pass Mulkrow favo .Condtton i havtog cau, Af Tk erceartes Your bY Qroup. MTR Bou ose uring Waving cleute fe Shourd be cyed fit Jrovry PY clouge. * Te Cannot be Wed with out Group by deune. © scanned with OKEN Scanner ect graery = extression| Groote Sanction, cele rom Acable_ AANME ee< gaveg_conaition>) vy columa_aame | EXP re L090 | @ scanned with OKEN Scanner {wre GvouP HAVEN 5°O!, Huey qrouP 0 Sa\ | DEPTHD 00 \ 4d Vractice, Mpg mio sotaroy Grn to “The Carga, ho “A Oy Qe tog wetateaving onlay SELECT Mey CGAL) FRom EME WERE ors MANAGER! CaRove &4 DEPT HO WAVT WG, MEW LGAL) 7 (200- @) wasro No ot EMPlOMees worming In Each wontch atleast 2 Eraplogers Ge Working. SELECT CoUNnTLA) FROM EMP Rove BA TB Haine, Countl4) > pso.oh Sraloqess oer, fn tach dea, martimurn Saleiy bis 2000 tras Mowshan pg te tens ® WAGTO tee hey Be Qexsng. sever COUNT) Geosp BY DERTNO eee os AWD Yoo: WANLWG MAYGAL) FS oc NetD, THaahenuon Coram Mion, aiwen Yeo All the ale, enn a they Oe gewreg Salloay morethan Igo in Zach deporte at _ seuecr Mi FRom emP VOHERE TOR = ‘Salesman! Awo SAL 7!250 Qroup by DEPT Woy AxCCOMM) peanCeomens) a © scanned with OKEN Scanner Practice, MwAgw Getting itatoaum Salary“ novethan 1900. {A Ey m) Aa ‘ “the ¢ 0 Salary Qivon to “the ANDAs UE Aho, Serect MEWCSAL) FRom EMP WHERE To? MABAAER! CRove BY DEPTYO WAVING MEVUGAL) > (200- BH wagro worek EmPboeees working Tn Each top, eonich octleast 2 Lenployees age Working . SELECT COUNTLA) FRom EMP Grove BA TB ig Having, Counts) 77% | PENSE, Seo loges coring Gn Sach depay., exe Sallesuy | blu 2000 anéiuy, ® Oo AGTD Lh they Be geving, MAH cevect counts) ROM EMP, open 2068 ANB AOO PEESE ET DERO. gerweers 2000 ANP M000 » : : WantwG MAXGAL) RERSES 7 ‘ maaiencny COPOmniaRion GIVEN fo a the ale Aang gablody morethan (amo Ww eran oF ene OS “an cach department: ‘ geuecr MAKCCOMM) eTVCeoM™) FRom EMP uoneRE TOR = 'SAWenant AW SAL 71750 eyroup bY DEPT HOY @ scanned with OKEN Scanner ~~ OASIS eee ar AS ANY 8 wWoralng +« - Ing Ae ey 8h ANeso ato . r \ gaan det : 10 ANG antec 2 Clow te oath opens sevect PEPTNG , Coun C¥ ) EROM EMP ane LsnEReE oR = bclevkd Cavour KY DEPEVO WANENE, COOWTLE)7=9 | sagrd ONO and #Otal salary needed 40 ait Crag 1 Ow Text Lh vhaye aie Atleast SU oe ia toc degee oO QeLECT Depo ,-cosBEcK SOCK SAL) ERom EMR, sk OTD nook Emeloyes acniny gal More than \209 wok : if cach Sow ane Me orarsal needed © Pay Ese a wn & goce oo MUSE exceed SR0o- SELECT COUNTCY) WANING GOMESAL) > BIO; FRom EW? HERE GAL >\20D GRwp py JoR ® wagww OEgmo and arumbes, Of EMP woorsing Only Ih trade ade Bee Working, AN. Gach KerRgimene ag MANGAS, SELECT PEPTWO, COUNT (>) fFromemp ' , WHERE GoR = trmanages! WAVING, COONT zQ + _ J © scanned with OKEN Scanner oa... =. #—- ‘Gee ee AD waged AB ancl MA the max cay facecds 2600 SELECT MAFLSAL), TOR FRom EMP GQRovp BY FOR WANT MAT CGAL) > 2600 Ley WABID “the Wradate vwolnickh CAO. duprtcas od ty J NOG Hen emp Fale — SeLect Wve dare org-ton J FROM EMP WANTNO, coontLe Job w) WASTD AYA Salary of Each adopt tH avg Sal is eunita, _ sevecr Avatar) ERom EMP Rove 4 DEGINO HOMO AVACSAL) 2% 2000 ; wD WAGTD DEFTVO BE tMBe ade Atleast BEMRIN Lach depend whose Name Was .ChoG VA: : SEL_ect DERTHO EROmM EMP : Reve WHERE ENAME Hike | ele 5 ’ taeove BY CERTNO BRAVING WUNT ZZ 5 ° LU) WABTO BIN ARD MAX Sqlarier “Of tach lob i Nin Sau Ts More -Hhan (00 and Max. Sad Ig Yeggahar, SCO" Sevect MINGSAU , MAKLSALD FRom EM? Groue by ob Ba. nee ee ere eo nen NOCGn hie ARGAL SS © scanned with OKEN Scanner Sercecr EName FRom EMP LOERE SALT “Senin! s QOS enpes RX Os a 1S x8 crs bY Clawie mus, be Written a4 last Clause fo the > used to Sort Yhe Records In Ascending or Veccendicg 4 wate ment: ext by Cheese CK cecales aren tte sleck Clause gy defautt ordes by Claute “gore the weords 14 ascending oN ered: > Hie CON PASS CATA MArMe Ov EXPreRKon at a0 Argument fn ordeg by douse. WE CON PASS Alfagname FA oFde by laure. SY AHO, r \, cevect AYOUP_bY_eFPreAsion [qrour function Rom 4oole_ nome [were 4 Hieeg. condivtony} . ) Logove By Colum-name LExPrassion] . Luavawe, ) ROER BY coma name ase] | Pesc+ "de of excecutton 4 FROM , & | HERE CIF used) {Row bynes] t * Geoopau caf usod) PRow- bH- ROW) Lay © scanned with OKEN Scanner Le HAVING, CPF ured) T Cw (( Avou ra) Be SELECT G ORDER BY WABTID Galaxy — 7 ascending ordog 7, SELECT SAL ak FROM EMP ORDER BY SAL Ascy SELECT SAL FROM EMP ORDER BW SAL DESc: 2 DOAQT®O SHAME Ty ASC ovdey SELECT EWAMG FROM EMR ORDER BY ENAME ASC SG WASrp SAL ay peEsc ordeg, SELECT SAL FRom Emp PRHER by SAL DESC « Bl sgry aa Ge ese cvdel SELECT SAL FRom Emme ORDER BY SAL Asc, GH wWAQTD ENAMe Yq Pesce ordes , 7 SELECT SAL FROM EMP oRDeER BY SAMA ogc + J @ scanned with OKEN Scanner ae . ae WHICH FS MOWMON Msido Onethey rey) 4 MeOH 6 Kaas ag Proceduge Ann oon > wore wo uttt be roving Maimum of 9 Wires. passer swe 2) Fane AUtery| SUB aUiony. Fane OXY wot excete frat and Qenerote the cubes. le urpue Generated by the neq quer wil be Aiven as tagut to the OukeR Query - . , se OLE HLEKY, tll etcecute and Aenerate -che olp. ? > his OlP UUL be the vesult- > 4 Anis we Can Sy the OukA We vy & dependendied on ane Tame WACKY Aoeardert- g [Rena | vahy - SUB, Mery ! Core When eves, oe WONe UIknow « uk Puk — © scanned with OKEN Scanner 500 muari| Goo toner clekadlS oF ARE MP Ac ecxoany enone @-—( servect * Y \ ERow CMP WHERE SAL (s« LECN SAL-—@) f { From emo — © | M—OWERE ENoeme = ceca Kv07 COO. ¥300 +609 Wooo > £00 s007 400 % UMW Y ED ‘ © WAgrp name of *he Emp Af Aho enploifes. Kiting more than — mtiley godlaxoy. ¢ SELECT EName FROM EMP WHERE SALT (sececr shu FROM EME WHERE SA Eames tities!) 5 BD AGP do detadls OF Whe Emptoyee cho axe ALLA Caley, : . ~_ Seect # ROM ENP WHERE NIREDATED a (seve WARE PAVE FRomM EMT Seotitan)s WHERE Exiatne > UR) — | @ scanned with OKEN Scanner ~ a wAsTD game And Tob of an TOW veg ~egouee CONG fo Sarno “lob aya ALEK, a SELECT EmQme, “08 FRom EMP wouERe JOB = Geen 30g FROM EMP \ LOMERE Ename =ALben') sage — dewaiils OF AN EMpPLoYyeo the Tro Ployeo a . aq dep Same daredtiment As WMS do Feitngase waning select * "ROM EMP were vero = ( SELECT DERTNO ni ERom EMP WIWERE ENAMC? Tome! ) 5 Z whETo details OF An Ennployce HE ce voorking oy ~ a salesman and ‘ney Ae gesting SeLledy more than aura Sabeady - SELECT * ERom EMP VLOHERE TOBZSAESman! AVE(SAL > gevect SAL COWERE ENAMED!TUING, geatedty “Sad “eoman | eenproyee OS, name, SOb, 5, WAGTD BE the EMpPLOyer and Bf wey Ce Teertay OF Some amas F comamni ANON and they fe worki ag Some dere. 8 tere} et acene nd: SELECT ENAME, TOB,SAL, COM * €RomM EMP WHERE COMM Ts VOTNYLL Awd SEPT WO Serect BDERTNO FRom EMP wae FNAME Se @ scanned with OKEN Scanner wasp deraits of aq Fe Loring AYO MHENAGEA acct Mex Ce (ews Ahan Hoo. Seueceyv * FROM EMP WHERE ~yoRLY AMANAY o4" Awe SAL bovo, Qwasre Actails of Ane Employee coho afle Weed dan the YEAS -And Hey ade. -Qokting Same Salony en! Clare salosy Sevet & FROM EMP WHE TRE WEEN Lot > MERE IREDATE REWER TOTS Jon tag Aun ak ; a , 188 aug SAL ASeteer gar, FRom Eup ~ WrrERE Ensue: “ciare); Case Q b| uohheneveg data co PA ejecked And HE condition to be AMoley, WOR Ue Sato Wery- H @rpcecuted Be Crosent At @ scanned with OKEN Scanner > Deve PAT Emowve we. 2 t (ti‘és*N 9 oiCaroagyy Pe tore wast oy SELECT DNANE FROM DEPT a WHERE PBNOT SELECT—DPO : 1 pers FRos ere user 20 > 30% res aff LOWERE EName® \chubby! pro “ st at eninad = Canine wo | 98 | vere | e eX a bron 2 Pe Feeream = Chubby x Chubby = cnabty £7 Chigai = ulody y. DER Name of marileg. eS cer Duane | EROM DEPT | WHERE BNO = Sevect BNO ERoM EMP DOH EER ENAME = Geet Hemilleg! Bat wWAGID hocation name of Bloke SELECT hoc FRom DEPT | Lower HNO SELECT ND | FRoM EMR ERE Enameo= Blake’ WAGTD or of esnpioyad working 4 an Coles deradtmen( SSLECE COURT) SELECT CUM KK) FRom TEMP FROM DEPT CRETE Mal WHERE NAME =WSolles, -— zt © scanned with OKEN Scanner WARTD acne of We ErAPlOYeo LIN Cho “ook og In crica ge SeLecT Name FROM EMP WHERE PhO = («: ELECT BHO EROM CEPT wWoWeERE LOC Chicag, " qo), @ scanned with OKEN Scanner x Ag . A & WAH dePaama and Location Of On Empinye th aye EMP Mame 46 ting. a “Getect PName, Loc EROM DEPT were pwo = (SELECT BNO EROM EMR, LOKERE tame! king!) tw) SPAST® details of an EmPloqer FF EheY oe working Aceounking dere: Qervect % FRom EMP WRERE HWoOASELECT BWO From DEPT WOBERE PAME Taccount') BW WAGED details OF an EMP EF they aje Worning fy aceountiag (0D caley department. Select * FROM EMP WHERE Pwo = SELECT DNO ERom PERT e Veale! pousRe Hyancelv Caccount$ seul

You might also like