You are on page 1of 12
Crome: [ he | Proagnm - 20 EXPT, No, : 21 PAGE No. : 3 SO. 1. STUDENT TABLE SS STUDENT TAL {flo “| To cuae a table named student 1 SG and_porfynm the, fal lowing opetaktons on tk insertion f vatues into the lable » filer table todd naw ablsubube Gt) modify data lyre, Ut) drup abtnibute 3) Update table te modify daba A) Diy jata_tn ascending onde ¢ a patttudlas cotumn. 5) Lrffouy by Funekion $) Find mintmum manks, maximum mail and the avetag, ¢ masks. 4D Deleke a sow it 6 Peocram Create Cable Student (Roll-Neo int primrosy key, Name vastchas (20), Monks dutmal (5,2), Doe dake); 4 Inset nto student valu» (1, “Agishita”, Mc, "“oow 06-01), Ingott into student values 21 “Amuni”, 48,5, “2o0y - 0F-03!); ftsent ithe Student: valuus (3, Co, Longa" 94, og - on -25)5 zi trseyt tho sbudenl- eC "Kithnendu", 46," 2004-09-06); < Wet tly skudent ydloun CS, "Satho!, 145 "2604 06 -09*)5 sdect * From Student 5 Scanned with OKEN Scanner 3| Update Student get ens ols eo : " : . | selec * ftom Seudent 5 Al seled * f, a — Ludent sider by mosiles DEse ; §, : 7 >| Selec: * From Student Ppoup by 00® faving DOB Uke 2004 x's [ i GI selec min mans), max (marks), vq (mastlea) Fstm Stuclenb « | delete From Atudent where _soll-no = 5; — Al Resucr The Sat program tua oxeuked suseersbully witout any ennos tg MysaL . oY OF Scanned with OKEN Scanner J PeogRam “ain || PAGENo.: 76 Son -2: Loans & Amount TABLE | “To catedke a table in SAL and perloam the followrng : | 1) Coeake table. loans 2) {mrt values into Hu table 3)Disptay tHe sum { Lean Amounts from LOANS table where the interest Hate (% mone than to. A) Daplay _ the highs voli. ¢ Interest fstom loan table 5) Count the no. of Customexa who name ends with Sharma. 6) Gunt the no Guboruns whose anterst sabe far no values entered 4) Display, ve Gans table in Aswending osidest ¢ Interest B| Progaam, Couake bable tears (Ac-No int patron ley, uat-Name varchar (26), lean. am tk, dnstollments int, snt.stake decimal (5,1), Shaxk- Date dale , Intexat int) | il Inert into loans values (1, "Rk Gupta? d00000, 36, 2004-08-14, 1200); ‘ll tneert_inko_toans values ( 2,.'5° Shaya’, So0000 Ae, 0, “apog - “g-3i', 1800); it} tmsoit to toans vst (1, ‘KP data’ eo000, 4, Null "ot 0s = 08" Aan). W/ tngent nko teary values 4 Yadhav’, Woo 6 10,“ ayog=in =a! 5 280), — [insert inty Aang _valuus (5,'SP sinha’, aoo009, 36° ag, "00 = MY] thoet Gite loans valuss ( 6, °P shawna’, Yoco0e, 60, 125, “o> 08, OES “i tnsert ‘no toans voluws (4s ‘KS-Phal’, secoee, 48 Nau, "eos: 05°25 a400)5 re *\ eee * from loans; seek sum(Loan. amount) ftom foams whee tnkexabe > (05 Max (ntewst) from loans tourk +) From loans where cust-name Utke % Sharma? s 6.| selec count ©) usin loans whole int rake 13 NuLLL 5 | ae Loans _oxdit_by into! 5 | + | |S Aesuur } ‘The SQL psognam war tauers filly eeerubed Using MuSqt_and it Fundcions without oxy. E—- 4 | EXPT. No. : 23 J\ Chowan - Qa |} [LPAGENO. 44 | 4 — Sou. ~5: Cuent & PRopucr aes ‘io pertoxm the Following waing SQL v 1) Create two tablis - Client and Potoduck a vals nko the table _ 5) Daplay Client Name and the Cooeapendity chy where city s Mumbai SA_Daht Fotom Client table 4) Chang thu gute f att guoducs ar 10% mone than sAlginal puree 10 Hhe Product Table - 5) Display AKC Poodudé Name, Manutactunet and Ereptow date ¢ produits who: uj dake 13 on oH bebowe 2o10- 12-41, { 6) Display, ca Name and (ty ftom Client table and tui Caistes ponder | fa eee Petoduek “Table . A Owfloy te no f mandfadewn to Product tapi: PRoaRAM 44 Gtedke table Client (c.1p tnt (4) patina hey Cent — Name Vaxichat (25) City vatchax (25), Pip hast Cu) 5 a Scanned with OKEN Scanne- || PAGE No. ) = tL inser ithe Product values ('T901,“Talcum Auden, Urk?, Wo, You 06-26"); Wingo inka Produc values Cres? face Worn’ 'Rec!, ks, 2o10- 2-91"); iil myer tne Produce vatues ('8501’, ‘Bath Soap’, ‘Apc! 5S, | 2010-04-15); {snus tke Rovoduc volun ('sHO6, “wrameoe!, xz", 120, "dora - 6y- 04) Y | tonert soko Roteduk valuer (Fyia’, “Face Wank’, x2’, as, ‘2619-08 - 1575, bAL Invert tnko Went values (4, “losmekic Shop’, ‘Dethi!, 'FWos'); ail MMsot into Client values (6, * Total Health', ‘Mumbai’, '@so1'); i © AMserk inks Atent values (12, “Live Life’, 'Dethi', ' Sitos’); AW] Ansett mito thent values Us, ‘oretty One’, ‘Odhi!, 'Fusos?) ; A Y | thse arto Client values C6, ‘Daeams?, ‘Banglore’, 'Tee1”); ort to Cltent_vatuers (iy, ‘Escpsremsona’, ‘Delhi’, Nuw);, 5 | select Chrent Name, City Frtom CLtent whete Gily in (‘Mumbai ‘Delhi’ tlseteck * From Clrent sted: * born Pxoduck 5 le Updake foroduuk sek pre = pate + 0.1 partee }5 seluk ¥ Pro Fotoducl 5 [. ud Pooduc:-Alame, Manlfackuset, xotsyOdke fstorn _Potoduct dake £= 2010-12 ly where Eeploy doe Selec C-1D, Ctent Name, Cily , Produdl-- Name, From Client C Produc P whew CPD = P10; geled:_count Castine manufacturer) From Pudduck 5 § Aesuur The SQL paoqram war suxcerstully unde C wnthouk ovtor exceutted axing Mysql and iF Q Scanned with OKEN Scanner To uw MuSar to partoam the Follewing 1) Cntake a kable Employee and \nvot valuis into it. D Crue a bbl, Emp. Salauy and ingest value» into tt. 5) Display the Fixst name, last namy and Clty 4 Employus leving 0 bari] yy) Display the, Employee table—tn descending ondey ¢ Finst name. 5) Display the fenskfame, _(aat_name and total Ssalany ¢ managers Where total « Sala + Benet. 1 Diplay the highst Salary fox Manaagus and fox dertks. $6) Paoanam = CHeoke able Employee (frm (D ink Cu) Bettman Key, FirstName vaxchas (25, Last-Wame varchai@s), “ily vorchastC2s) 5, AL tnsett Alo Employes valiuer (010, ‘George, ‘Smith’, Howard); 81 tngert_tnko Empbyes vals (5, ‘Moxy! “ones? ,' Pass?) Bi] tosent_tnto_Ernployer, yaliiol1s2, Suro’, fone? , ‘Upton’ ) 3 WV] Ingen _soto Eee vauol Us, ‘Sarah’, ‘Adeenman', 'Betston’ ); VI noes Anko ran values (248, ‘Mant! Sengupl ‘New dehi?)5 Vi insert trie Employes values 300, 'Rebuit', 'Surmuel’, Wuhingtoo! 3 +— Select * Fay employee J cneate lable £rnp- Salasy (€me- UD ink Cu) prtmany key, Salary Ink, Benefits wk, Designaklon vasichast (25) ; = {sett into _Emp-Salow values (010, 43000, 15000, 'Managen’) + a Inter ike Emp. Salay values (105, 60800, is600, ‘ Manage); (nseit_tnto Emp Satany vabuits (152, 0000, 25000, ‘dineckon”)s | tect tnt Emp. Salony values (215, 45000, 2800, ‘Manages) ; 4 af = ansott tole Emp. Salony—“Vatues (muy so000, Rose, Cenk?) ; snvut into Emp-alaxy values (300, us000, loop, ‘Clexk)s selec * Pato Emp- Salany 5 5} select Finst-Name, Jast=Name, Gly from Employee where Cly = ‘Pants; _h.| geteck * Ftom Employee ortdet by Fissk.Name dese 5 5 select Fistst-Name, Last-Name , Salaxy + Benefits ar “Total Salaxy! tom Emploue 6 Fmmp- Salary S_ whee _E.Emp-10 = $.Emn, |__6.|selet max (5 if =Salany group by _destanalion haven deatqnatien 10 (‘Manag Moe’) 5 | Liew The SOL pHogram war executed succe mm 7 a nd_it fyndtons withsuk over. MySae | Pg and D, = : "44 asgnation: Manag} a. ee ® Scanned with OKEN Seana. \ \| pe Paogea | ___Squ =: “enciea _awp testing —— — To ue MyS@t_to perform the Following :- 1) To _cHeate a table « Teachen_and_tnsext values into ab. To Guaoke a table : Posting and inset valizes inte ik. 3) To_count Hu no. of Teaches to each depart tment 4) To display the Fist date fon and the (abeal_ date pu 5) fo display Hhe Name and Department and toe counesponding. tty Fost ' a. Teaches in pdt ©) fo show debatt, { atl Teachers tn Histoxy department. \ 4) “a display the. nam of oll, Female Mathemaltin deachen. , © Display the all bashers 10 axeinding on & dake ob 10 v Display the name Salany and Age of oll male teachers. 10) Ogptoy the Name of all “leachors along with the Bonus which i the J v 10% f Salary. i Vereen) | Prowaam 1. Citale able teaches (11D tnt Cn) psamany key, Name _vasichar (25, Age int L—1 Department varchasi(2s), Dake-oflon dale, Solow int, Gtender chanca)); sot into Teacher val U, “Tuggl!, Bi, ‘Computer Scenes! ‘2or4,o1-ie', R000! i », Meat Into Teauhen valueal2 ‘Sharmila, 31, History", ‘2o0"-03 20 ooo, | Fs i. 5 a = - ot sake Teactes_valita 7%, \ancdep!, 2, ‘Harbematut, ‘ot ie, toon, 4) “Shug! So, ‘History’, 2004 -oe-2¥) goooe, "P45 Levat_tebs Teacher valuas (1, ‘thier! 44, lompat Suen’, ‘300 - Yolo Teather valuts (4, ‘Shalabha’, 35, 'Mathemalt, ‘Lo a bas) 21000, 1095 4-41, 20000, ' babte Fosting (tio ink) -paxtmany key, Department varchar (25), Place = _ vanthox (25)) 5 —_ S 1s Unto Aasting valuen (1, Hisonsy?, gata! ); ihn who fosting vats (25 “Malhemattas’, ‘Raiput’) 5 Wirt into Posting valuua (8, “Compukex Suence? , ‘bahi?); 4, | Ail sleae depontment_count (*)_ Fsum Teaser _deaup_by Geportment 5 telul min (dabe- of join), _rmax (dake-of- fotm) bxom Teachoty S| selec, ame, Department, Plow fron Teacher Ty Posting F \ white toepantment +P: Department and P Place 2 Souhi?s 64 slack Eien “Teacher _whune department = “Histon; dupattrment = 'Mathemalts’ and Gender = | 4 sede Name Fnom teacher whore, a Scanned with KEN Scanner PAGE No. :

You might also like