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

Dbms Oracle1111

Oracle notes

Uploaded by

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

Dbms Oracle1111

Oracle notes

Uploaded by

roshanroy42231
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 36
_Laeniction GL [Sdearchanead one ) usa ae to Notobese. T4 cin ee. Geeathion Toate ching data on eas & Deluting dota aud et, te Commands 9 anstuckion J+ is see to Conmumicat-e ith the dotaboso. Lt vs aulto ened to pusidgum Space dank, NeHon & quis of dato, QL Con puxfoim Vosious tasks Lito owode a doable, add ofa fo dablis, diop tho dab, modify dha dable, act WUNLEBION Fisk LLMOSLS TSPES OF GQL ConnANds Thane axa foue fre of SQL Commands DOL, DNL, DCL, T¢ and De. Su Command { y ae] be ace oe QOL OML eee | Crote Insect ii att Solach| Quop update —_ Qollbark Ate > Delete Souk (out touncale DML2OML commands ae used to modify +the database. 43 | eEsponsible dox alll dasim of chi din dhe database . Ina Command of DM ws not antto- commited thatmeans | A can't poumanntly couo alt the Vargas ain ths dalabose hay Com be ralllbciok. Inset } Tho inaot etatemant Unswut data Gndo thw of ASO Yuony. Lt is Ute +o ow of a table © Syntax : cWype 4: Inawd at Seca pyNgax ? Inset of dable name Valu (valued, yaluor,-..) 5 xomple: Inéot into student values (4 "Richa 1207) 4 ype? + Multiple secoud Kyntas: Indot indo dablo name valiy (cols, ‘¢ol2',...-) Rvampe s Tne dnto sdedont Valu Fino’, '& rama’, Syntax : Updoke + This command us usd do yntax + Update druble - Nome aot ~=- Column - name = Yolo Example Updale students sat Qu Richa” 5 Delek : Ty 1s Used to yomaw One Oh may Syntax olde Som dalle Nome (prthor ¢ Exomale : Odlte Seam Studon+ nthow Dau [eatumn Hoo dyn o dablo amalitrisn) 5 Wome = Richa» 2 Y ces) dynes: Insw spreitic vecod Triad unto dablo name (cols, col2, --) Value (oaluo 4 - Rxompl i Tnsod ando sdudent(nome, claus) Vorlutos(: Richa’, "BCA’) 5 date value ofa Calusa dim he date oO Hrn-fome4 = Valued, - NI LNAow eandibion J Be | | Dou Data Dedinuhion language CooL) changes the sheuucduste of the deuble Hike easing o dable, doling 0 duble, leary @ decble ae IL the Command of ODL aie oucto- Committed that moons ik || fermanindty Goue afl the data sin databerte. | Commands that come ander DOL. 4. Oraate ) Q Maes 3. Dap 4. Teuncate h. Geote 2 Tt us edad to ceroote Onw dable ein dedrharo Syntax + Gale table toute Wome C Column inet a : fable table Noms (Mame vaxohaxrr(20), 2 aoe emacl Vouchax2(10), DOB Date) ; : | bp. Atter : T4 fs udsod to alter the sdeucdesee ob the datebosn. Gps change could be tho modu tho Chosactuustics of On exis beng akeubutes O probably doadd Anow oaftubute alo add a paw column din the doable, Alder doable table name add Ceatumnname column dif) « do mo Huiking caluumn vin He dable « r Ader Bd ore fain Cename voruchax 2(25)) 5 S de ee oe . Dx 1 Lid used to delele both dhe af & =e ee she table. pees Syntax: Dxeb dable 5 Examala: OXep dalle ompleyed ; ie gel Bee eon ee tes ec A al ies ) 1 CANBY She ramus of all the employers who ween Loeing im 7 ctr . I, Display, the names of afl She ONE nho aw Nadas as dorks & dawing a dalauy mee than 3000 , W+ Digntay the Employee Tumben & Name rho do not GOAN any Commission « - Ougode T+ fh uand to ovate a neddable on tha dabebase . Gyrdox > Groale table doable name l Coleemn_ name datatypes C.J), Exame@lt? Gerale table 8563 (emp-no Vaxchox2C8) pu heck Cemp-no Jike E'/.), ename Oaxchax2(20) Not Muu, dept 20), Sats rumba (40,2), hine-date date, Carmmissiion Member (4) Tnsot t dhe ingot stetement us a SQL queasy. is urod to cnaet dota canto ths #ow of a table . Inseot Nutiale Record Syntax ; Hu Snsot unto dably name Values (& cola, & col 2,-.) = Bec: ae shee Unto doubt Emp leyen 8563 (Emp. no, Cerne Pes & DestenAt ION», ‘8 Salary shine Oase ee Thsect sprcific sucord, : ynax: Inset into ae a, ee ~--) values (vale ample: Insad anto emplqyee 85630 emmp-no, name , olept, leprae Ten, Solawy, Dot dole) Values“ £5, *Shuyash®, Salers Pralit’, $000, ‘4 - man-~2000!) ; “Ealick: BRE vs Selict command uJ ined to velit / Aplay Umdwunaction Suom table. Lh uel do sedred the atfeubede | wed On Condition vole fy nhono clause , ynton : Selec column. nome feam dab Name. hw Con ditia. rample : Drltel * Fon employes 8563 j -quolly Opaxator + This operator vis used do vetutue all hes views Muth cvctain Column Values. Fhe follauing Gotement wstind oll dhe souy thaw class= BCcA-d Syntax : Select ename gaom Emp leyeo 8563 Kuhoxa dap 11775 And ox OR oftrotor « Nhon both tho Canoluhion cue Solisfird thon the vwuotwoun wuld os bow , Ex Solved encune Fam em) : a Peper 8565 Mheue deswgnation Pee oe and Susu > 2000 ; ruth the vols Sprocif-y thon o (eas than o pone i. Sena beer selec 8863 nahn agra = Value Ts Not Nut) ehw0to Ud do go Tey Salted the emplieyoa s Wrote commis scan Bs null, “buactical No. 2 ve Ue cca te ce A salary maue dhe n | ae oben ae | HD Domes oA tha em | ntho one Neking um compury Sor th goal eae ae - Equabity Operator ! This ofwiotor Js ute to veteiue off thee sous with evan calumn Vals. The ddllecen Statement vuttuued all the wows dho une Ex. Galoct feram adudont prhete clots -'BCCA - I’ 5 t+ Yrtanter dhan | cess than operate « The opto setoud huith dhe Valus of ee column. or ex (233 than o a ane dole spo © Sallact %& Sam empl nihaxe olor < Saves ; a Goleet ¥ Som emplayea uh aolany > 50000 ; . And Operator : Nhon both tho condition are ) d thon He urtouwn vical is due | + Select Cnamng ie empkyyeo 8563 nehoue lealgnation | > Ca an’ ‘Analy! Jand Salosuy a5. IW Opmroter > T4 select on Gan ae ee Shs ee | \ + Suloct ename vers Plypon 856.3 nehore clestona ti IN (A ee im | i orl Galanin) Ord slau 3, wWthoxe clause: Nhow clouro is wrod cox lr LL used to place condition on tho calumhy adorning dhs foul op dhe lout wall act of dhe guoup tose so ase not soqunad do ure dha Combinad Funedin Lue Ke Coonttc) awme) ete. ruth GM Whore clause, Attor thot ae ea © SAOME Farm EMP layea8563 hog fochax Coysdote, Yay!) -t0-chax (how dase )>=5 5 p-Slect Command + Select cammand us usc do cub / | Umdgaunation guom dable, Lt ys used do avlect the ohtubikes ubasod an condition dtsoube bY Kuhwe Clause & Synsax elect Column name duam dabe- Narre prhwue Condit an ) Ex + Sloat Nome, Class fram cotudunt whoa c loss “Bet Displaying alll Guceraly gam sable | Agar: Selrct ¥ dom dable Name ; | Cx: Solock ¥ Som Sdudlum t 5 A. do chax : dhe to-chax funcdien wn orack wy vod! 7 | Conuod a Nous of curey datastype doa stung gopHuuton om Uding 9 poopiid Seumat LT} can bo uted do donune , dates , umber ck otter data dyps to a S poofuc choractous doure Syrta> «Jo Chox (Oalus, Seurad ) We aad fo Uke ahouwory , Biacdical ny \ Duabley ¢he nares Od all tables Lorn His; ». Display He Namus of seplayee . ng un te ruumber 30 0420 &% Yo oH emp| dulmon 0 Fralyat Plyzee Kogueking as Cloke , SS ———————————— 1 ORopato: KLhen both the conditi oe ol ae i ¥ Yon uM ae “OR Hpoieuned 3) an aol Eee res Sgr opiate : UY solot only those HOU nhvy yotus ws ara that iat tem umcluole Gn Powandhes () . » boluct ename for © 3563 ribo clapton on _ pare tts ie pibwee olopt no 4? Re ae) OR olegnaticon sn Cicluck’ ‘onodytt ' sole aa Ve ¢ 5, Mhowe Clause + whoo Clause BD used ox dlectolun pipers Th usd to slack condition on the ae to duloumure sho pout of dhe Jos! suawlt sat of the group. Hoe, Ke avo not sug fo h0 Shy combed Sunchon eth bce count), sum) ec rect how LoL? x + Salack ename Grom emplymss63 pthoro lop + 2 Cadlocd dup! rama $xorn daptss63. rahsie dapt_no din (Jo, 130), ye’) OR BBGrakion wm (' Cloak? ‘osralyst » *saaman’) 5 €y » Aoloct ee Cos Ferorm etudont mihwe closd COA Js ae tbs she none oe Wood um tho dosrbase Ex: aaloot dname Sam bah ‘i il Jiahlay the Name of Os NANAGERS, Ne Employee Maho ae no+ rakeung () Kike opptoter & The genoral Syntax of this opwiaten 0 column Wike pattern. 4 aetoet ath those gious chose column Value matches the character pocteun. spocplad by Potenn. he Column dota type win this cous must be : uidthor Chovacer G4 Voxdhd2 nehon the equate apucaton 4s used cxacle dees an exact roe da luies ae the Sabls Column But mrben fhe lee oprratoy is used the quoycan be fs suatdtruc du us oy doo mele aol 7e &_ um dho chatactex flatter specypeca ho), Ex; Gulacl ename dom emphyfer$ 563 Khor enamo Like “5 °/. GS @® Aplack enome dxam Empey 8563 whee name ike 4 ah’; ) In opwtater : I4 aalod only thea « us nihoss Vole es Dik Shen Grell Jn Quoosrohasia <4 n Ex 3 Select ename Heam empleyech553 rhwx dusspmation No (Manger); Z : Not the hha she go 19 peel by oe abl alee fod ona ob the Loud idem, ns ’ Quntax ¢ Soloet *% Seam doable Name &x } Goloct ¥ Sxam atuclend . +, Whow Clouse: Whew Cours Es used fox udm deciding Bee ae ubid to place candition andthe columns fo datyuming the pod of gho dost soautt sal of Ghs qloup. Huw, Mr ane OO yucquired to ese dhecanburid a tke Count 0), Sum) etc, hth tho MAwL Chu, Abby dhod, rit reso! fo ust a Heung Clots. fx! Select name fam. errflsptedst3 phe enome Lie *Sf-" > Bolo ao 2 Ee wo wud bo ditto the val ag Vols that aw montiond as pu of tho IN ofaxato Ws fot sakstied. | nda 2 Galect Column noma Guo table. rams rihoxe Aolucnn Not in (valued, voluer,--- )y | €x + Goloct ename Guam emp MABw darsgnostion No 7 (Maragen’) 5 ; ae roa Display the total solany paid toatl employeas ; Displays $e marcimnuie poe being paid 40 cLerK. Disney Hename of the Zmplasiea aton mith dhein annual pa ees poner eeu offal waning ght annual dorloviy shawl afbbtor dirs. Salect + Goloet Command Js ured to seoleuue fd) neoumatien THOM tab, TH dtd te galocd tho atiubetes pasado Condlition dlascsiiho by Ruhww Clouse, syntax + Galeck Column name For doable noma shoee Condution ) Whore clause + Athos claus fs ented Gon decidua (Uuepore is used do place condition on the columns 4Caleumima port of the tard somtl sot of tho Howe , es Not Saguired do cue the Carnkuno duunction Niko count 0), wm) ete. Kuh tho how Clore, Adte NE Ned do Woda Howwing Claas | eyntax: Solect Colwmnl, Samchion. Noms(columna) Secor doable nome hex condition Sap buy Column d, Colum? Hawing Condthen exolex by column 4, coleman 2; 7 * Saloct Fak.) Homem ployer 3563 raha dep nating es clases )Euality Opwxator : This opwoter us usod do yeoteuno alll THOS? Geis KUN crctain Column values, , * “loo max (Bator) duo employers Kehoe lost nostiin = "Close? ; syntar. Save max (Column pamo) de oe te ey > Guar max alasyy) Jem enplyat mhwudognation : =" elo? -Qodo by > TL is und osu dhe gual. sab om ascordung © doxcomding Grdor . gapinx rSedecl holuers «Sram ents pahoee Bocokoe bye . CotemAd , columns -.. Asef PES 5 Ex, aloe enama dom emnplyya ordax by Nome ee? (ee Arboet x Suave dale name cwclan buy dst | Nome asc/ alse ; ectial 90.8 —e ig(ay # name, Balu, hua, pf,da, totals $2 wach emplogyet : forks cuir ene of REN hoo 4s 7. Od— da toy of alow, p$ s¥ solos, dobal nil be pe Csahay + eae ay ae i isay The Names of the empl un Od of dhe satay. ’ the names oF thr emp Miho au no} aauking as [ es OR CLERK OR Aneee, a r ws Gabe Command ! D@L us Used to getch data Suarrdoctate wan WU uded only o2 command @eloot, oe permed Js cisod Tee ee Bplay undsunation ent fiom table. U uted to soltot dhe atturoutes chard on Condition closorihe hy athoro clause. Syntax | Sslock colwm- Aama Com dalle nove LAvee Conelition Example: Arlect enams, class dram Adudent whos class = "Bees J” to Diguoy all the sacerels Syntax + Select * duo table name Crample > Soloot 5 Suan Student ; ; LOydoiey: In oracle, the vce, Claus us used to sout Hy oom got of a W ascinding 04 daeconding ou cler bosed on i CE Ee ov “ Syntax + Select column , column 2, --. dxem dable_name Odelor.By column [Asc | Desc] .. Example: dolec! ename fam empleyee 8552 coxoloe By Sa losey ; ws ; . not 10; Thovecle the Not IW claus B udel do st shad a twctain Valus ov get of avalues shard not “ube puuaent uin the veel? sot ofa quowy, th45 rownanly uasd Wr Cons nedion multh a SMe cae ae ede Gyndax + Galect colum Not IN(Valuea, ce ae whoo column J example : Golvot aA | to! WC Salaran) Gas pete puhow olorignakin Hl Q Whee close + howe Clause us used Fox cooling Th us Usod fo place Condition on th Column ooereumines The Part at ho est wuld setot the Group: Here ay Be Not suquvadl to uso the com birec/ Sanction lilee coonte) , Some) etc. ruth dhe phone Claw, Adter vAod nue necol to ute a haung clause Ex i Golect ename Som employans-63 nhoe toca Cys dade. yyy 4") 40. chan Chie -dase) >= S 5 a Practical No.4 : Dist Ne ( os thename of sete he oss renee po fan He ugheat salary of ory Olouk. W1, Ddasploy dhs Aggie & of dha emp layer Avro ear hig head | Jeupual in Shan Sean tet cua Mafcbconvand : Selucl Commend aa aa neeeeaanay | . sod to seoteerue Bay ene Se tebe. Tt uy used do ne, qitecibutes cbadad on Condition descurhe by rihuu olarss Lynrax & Geloct Aame, ctass dte column-name farm tHe name mh comadition. | Do cnto, cn Class = ‘BecA-L' 5 Dsploying all Hacer Syntax * Selo ¥* Fam table name + x. Solel ¥ dHom 8 fudlent, lause : bor, olacicliy ee u As, ubed to (oe eonatition an dhe coltemns go ALAVUNUNA tho areuberse part of the (oat Hl gut of the gicee or not voqucud fo ws the combied func te, pith wrhvrw Claude , Ude a claws . din eek Count ®), Samy Atte that Wt nad do &-. avloct ere) guom emp lpi ls63 ribose SoLasuy = Capicd may(scloruy) SHO emp loge BEE) §, Equality opriatox + This opmator vs usod 4o uta all ne OWS Nth Cootn Column Valuw ae, JodMeM tHe AM the aus dhewe class ~BCCA -L < 0Select K SUGM Aduolont nihwwo clas ‘BCCA-Z’? | @ Golect ename Fearn emp layers 3 Whew salary = (dvlock Narc(Scrlasy ) 3000 j maxC) ¢ In Ovacle, the max() us used +odind +e MaXIMUM Vol ina au JB Valu, Ti can be cused noth numbat dodo. types ous ALUM ars pith date and dime data fypas. eure + Galloct Max (eculasuy) Ars max salasuy 40m emp layposs 5 J Bacucal No.8 cee gare ane ia ae “gahoy Hu dob Gpeoups chawing doreul salasy gouotor than Bia. aroma Sallosy SoH manag ang | Gisplosy He Nomsod dhe emplagets in Upporcass . Diana TM length of Your nae using appropriate Suredin. 1. Gelect Command : Select command fs used to vokeiue (daplay Storidable, Th sed do selec} the atteubutes busd on Condition clasoribe iby Kehoe clause . Syntax + Galoct coleman name Cam dable-Aame rihore Condition ; Ex: geloct name $4or empl 3563 Who dopt= (eoloct dlabt+- name Pom ceptss63 rohwH location ="chicapo”” ; ). Who clause ; falhoxe clause cis used Sen cleciding prvupos2. HB used do awe condrtion on dho Columns te ditfesuming tro partod the las} weomll sot of the geoup. Haru ,rre a not sunguiixed douxe dhe Combined Suncdion like Bem SON) che uth ahs whow dae apne Mm 82d cto sso a honing clausa. : Ex, Gelect ename Sam emp leyeesSES mehexe dep t= Cselect bt camo ¢xarn cebtsse3 Kho location =' Chicago") 5 5, Equility oferalloe : Thr opmrotor & used to volun all thee Hows puoth cortain column values, Xt Soloct cLonionabt sum (Salary) Som employee 8563 gieup 4 darignaion ing arm (sallasy) 5 (soloct mare (Scularuy) Secon Empey te 856 nudges devipnalinn ='manggen’) 5 _ so quonp by : The geoub by Sanction is Udod yin olatabest oiies © GOL Yours With dhe Game Valine mio seernmoray ould . This dunction ols carnmant tasd din Copjunction nth gragode Sanction guich ax Coon 7 Stim, Aug, ee., Fo preouscle umdoxumalisn abeut o Specife i guaupod data phe a Columns, abe _ Sundin Coolumn 2) 45m obs OMe Kee ean an Ytoup by Column 5 ant Be i 1 Sum balay) gm empl 563 | RY * : puoup by clastona tion dawuing Sum (Salas) > C aulecd mare Cootasuy) om emlouer 8.560, Chesignation =m Dr peRaeet function The uphon Sane els ee Geeta suing do uphocase, Jho syntax do upporcase, The syn dare UL Sho OPPER Bunedion uss as Follorus : yndee ; Salect Upher (Column namdfesn dab rams 2 vy bolet cpp Coname) upper * ftom oryMeyer $56 3 ; Function én oracle : The hergdh femetion is to suetuun SAr mumbex of 6 eae Bie coed tergdh (oisury )deam dealer Ga > cSeloed length jay’) “len” Sam duos 3 2x sI¥elet ename Seiorn eMplonee 8563 phere += Gebel dupl Name $4 orn diptescaty ~ Aho locoubion-"chieaga'” 5 Sulit length Coname) San Cmploiveo 8363 ; hangdh C) + Nhe Aangdh duncdion ud cesed do oirtuwmn jhe nwmbor oF Character vin a Sdhuing Eyntore + Select Length (Stang ) decom decble nome Ex (belie Longdr CT ) en ee 4] belecf length (enttme ) feuisr emplayer ess 3 3 Replace Lane tion « The Replace feanodron Bs uted fo reply Nocounronas o£ a Substuing nuthin & adeuing pith Be uisteiny » athe yntax doo dhy Robloce $unchicn wW as gol : 0108 ¥ Replace ( Stein Subsduing to. 1, Seplacomen + Stet iy & i I 5 t : t Sey Selo mags ee a Gyrtax: Soloct Column el Condit m™ Ex» Qoloct Nome, clacs urann siuclent that a » Ee OoN aay. Disnlaying all suacevels Sar table gypter Dele 4 Groen tabi, Adame fx 3 elect Be Ligne employee 563 5 t) Whine Clause : hoo clause 2 used Lox Moen h a used to face Condition on the colwmns co eae Te portot the Wort veoult aot of the Boup. Hao, ne Genet saquixed to use the combined Function Wee counti) Gum() ete ith tho rihewe claus, Apter thot, wi ng0o Yo use a hawing Clos E+: Salect Chea tonacion GHiom employee 8563 rihexe dobt Ln Cauet dul nome Suen deptsses mh clept_ no Not L0(40)) 5 ee ee 22-(CN- 20) gysdateO + In Sea, the Sysda te ©) bs ured f pee" eis tence ae ee Date value. Sho Sysdate Sancdrar dots nod FOquey ee og called nithout parentheses, ee ext delet S4sonre cen cual > Month bats () 4 Month butuisent) dmoleut dhrencumbe 6§ mondh pars GU Fo hokey, y 24 a + Chock the df oleae condichion uh af Cr Oe OL =O) us sotisodl eho fun + the AS 2\LOM 4&2 TE condition ds not sotishi ed quant tho number 23 BEDS . Stop odd . Enter valu Fern + qy old 2 Number Cs): — & , Mw 2 > ArUmben(s) 3 = aus $ho number is eam WAG) prouduue auccesssubly Compluled. — p Nuide APIS lock te Gy 19 sus ce vege ot shuclint KG aaa | seh » Heclases [rosy Ree Se ee ali S#P 3 = Rood the y SPY” Check € pax (pwieentage) : lable { gap 4 * dat one sep S Check the ‘Condition teams Ss > set i ind 4 Sens tae gxpe) Bint eens Sept » Stop 3| ra). loop Beto *) 5 9 end loop ; Salud pul dhe (tec a todbms. 14 end; SOL >/ pitt nls foun 1 i cdo 9 nen ; : ud Ff baste. Salauy < ieee 4d - coe Wivoms. han o00 then cakurlrte 44 Else calculate Mmiome dux 1+ basic salbuy € 0.08 HS: Beint Facoma duc a6; Sido ot =badic-s parr re

You might also like