0% found this document useful (0 votes)
24 views52 pages

Dbms Lab

R

Uploaded by

useweb302
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
0% found this document useful (0 votes)
24 views52 pages

Dbms Lab

R

Uploaded by

useweb302
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
Z Cab Class -3 fo Count “The Number af Records In a Table . SEL) SELECT coumll®) FRora ence. Storade nts Ord put 3 roost “| 4 SO! — Count) is a fonction to count the number cf lows - 6 ytew the records tm @ Buery awaiding the dupliaae econ, ir SOc DisNal % From mMeaStudents Output PaT| meme | mak} Prone| Meld” Tanimsse] 89 [seize | BALANGIR | veceax| %5 [anusson] Base, 34 | Ayott Yo | ABHstOFl | COT TACK MARESLOAR, _— - - ApityA | Gt [sr¢orAseoy COTTAC Ks keuTtt BI “BAB6UF330 KEONTHAR VExest Au 8 BWyasqi,) COTTACK . TOUS Meluned Yo. od sece nS 72 sat? sgvecd DISTINCT NAPE NAM? Rom me \ _ COUNIT (ackt «035 ) ea SRLECT COUNT (DISTINCT Address), COUNT C*) FROM MCa- tudes, Coctput | ean Cors-TINeTERCSS) con cae Coon) 4 4 4 rend rechuened in © ea \ : oapen BY’ CLAUSE Norden by" clause Is ueed Fe cor} “Hoe rast OFS ny Volwe « queny asending on descend" onder of Colour Colowmn Number ofc. Serb SELECT ORDER, BY rmartly roll, meth FROM arco students SQL 27 SELECT Tol), Marth FROM Mca _ SHtclents ORDER BY Marth, desc. Gerpuld - ‘y ROM SP rmncte, 5 61 by an 46 aI as - a #4 34 ao sc Prcew s recharged 0° ee Curt ped =>. ~as | U6 =— a 6\ 10 seconds es tuotuaned Wo? dase “@Roup py! CLAUSE divides The f Sheete ment group by chau, IO selec ros CHa Y verred “sable ort view Ivo Smaller, QreEPS ound ma poschicatare Sequence no. or city COUN) (*) & RON) wICa- Shure displays The cutput nis SeL > Splect adders» GROLP BY Odes ORNER BY NO- al cry Curput addeccas No. oF CLTY BALANGIR, 4 | DyBSRL 4 | KeonguaR 4 CUTTACK 2 “Having Clause" = H operates Same Fashion as (tet co Bl Where Clause » exert med Ae Waving Clause on group Functions C“qrove FUNCTIONS a perce Lucien which cperctes on multiple Fotos) whereas | Cegporte” CLAUSE epenctes On Indivisead OWS - SOLD SELECT addres, count() NO-OF CITY FROM mca_students GROUP BY address HAVING —Me-eF= CITY 2 HAVING COUNT CH) 72 Outpud-— Padiceass | No- oe CTY | CUTTACK, = “UPDATE Slaernand 1. [EIS Used to modify omc uterte cy almwady oxistns teow of a able. BOLD UPDATE, Mea Students sel Newe = ‘KRUTIGANDA tOHERE RWBdet reoll = UG LPDATE mea Sludewls wy5 Set mart = COUERE Wl - so E Ot OPPATE mca. Students set ockress = Cour na! | CoHERE roll = SO | UPPATIE -mMCe a ca Quai (234 ‘ WHERE Toll = SO | Outpud - = odkdiorS Troll oe : (| ub AwAZeUrs3C KEONSHAR po _DBHOU® BALANOIR aS aM 435020) | | @8sp oo aouaaar2 | COTTACS of | AMELEASO| CUTTACS = ADITYA BIGOT} BON CUTTACK 6y Pikes qeaneaey CUTTACK a a LL -_- 1S [Speier te” statement = VAIS aed fo delete adreccely existing Tow OT ows From & salle. get > sete DELETE FROM amca-Siudenis > q row) deleted [Link]> Me deleled Ow __ ees 6 32607 4 secu 1 cerTacte| Where Famc= ‘ADIT YAY eet EE SI a IB.) Jo add anew Column to an exist Sccble SeL > ALTER TABLE mca. Students add Trcvias Stren vat iclyeerQC 2° yy Ouaput : : quble allered. | To modify Sno dotalype a avy exist Coleen CONIY ¢oP word Type’) NTAS VOR The Calumn mame seat phoren SELECT Hell Holl-ne ) HAMEL Gedoneme , Phone PRON wea edude nis « cocked Falco) — fast Nose phone me | \\ AMIMESsH — | Aearsyert™ | 34 ayou qaMs\64 <0) Ge | KRVTIBANDHL —fpaacera 330 as | DeePAls qyiyaso2et 9% a4 ws) eu | P\KeSH ™M raAMESORES | 8 Bai pay SO cet 2 ALIGR TAAL anea Sludewts omectity (Revion’ Stnoei Nanchaa2? 20) ) oul put “lable ollered \y I 19. N2@- | © Upeoarud type? means B tte cledertype of Cokwmn | th com be modified to vareclad2 tupe Dumler Con Worrred Merl Similarly ,a Sailer ered au her 20) te larger are. Bul Ke ceevercts jend abot a eae atl] Phone | aklacrs 7 creo] anaes | 89 [A€ezeen[BmaneIn I INetl NO Jaatyaterser| CUTTACK | | Us | KRUTIBANDHU| SI favaseass0 KON THAR : 3S _DEGPAK | BS jallursscae!| BESQ | ey} prkesH AV [aaa yasqua | CUTTACK, TAPMESINR| As Todrop A Column from aalee. gutpet Sel-7 ALTER TRALG Wee-Stelenbs PREP Cole MD) Preevious Arecm eurput “Valle allened 0.0% Seconds, | | , 20) TABLE ALIAS sat> Select PAPI, WL manele, he Prone, #1 OMG 036, FROM, mcea_studenls 1 WHERE MM. mark> = 59 phone addr’ | Ip, | BRLANGIR: 45 CUTTACK, [: Taninassn | 89 |< INOT Miler Alldoimy the tos Brod tebe is? caus SGlecte & FRonm mca- Students Phone adres | | ANINIESH qgq2stou Same | AYOM ; : | gosisi6 4501 CUTTACK a KRU TBANDH | § aba69330 | keowTHAR as DEGOAK ah uasoa0) BaSR etl Pikesh ASAIUYIBUND, COTT ACK so | MAHESUAR |@ryarqir24 | CoTTAC(, | He ———_ lab Class — ( _ ; PSEOdO cot MN INA TABLE. die wen WO in every able Columns Such as: | | ® reiwnom (b) rtowid cc) susdete ete o> a To display the row number. \ Tr addition to The existe Colrmns cireatect able some extra columns by cue poevent hese Columns GLO Wenown as Peed nn) a tobole | sel > Serect rrevonum , Peoll name FROM mca students De " fa | B To display the “ saygtern cate eel D SELECT roll, Susdate | Codpuk? | NAME PANINIeSH_| KRUTI BANDAU! PIKESH EPNK WESOA a i ABLE ° PRON meee Schuclemls a3 Curpul! Wl! cycle vy | pra aeay 97 | WEE uc | WP 90 aS | vtpia] 2084 6y | Myra 2084 So | Wh tat 2038 To display Whe row iw I clable - SOL> SELECT row id i _ owid roll ARAL EAAAL AAKANVANA i ANAE SAR AG AAR NANA, 34 AAW ESA ANE AAAANWANC WG AAKE SLAAE AAAANVAAD 2S AAAL Bt ANE ANAANy ANG 6y AAW Eo Ae ANA NY ARG | SO CG row tootuccned 1 c.00 seconds SQL OPE RATERS x) Acadhamelic eperectores GY Characlen Opereesters Wii) Comparacery Orperccel ons 7 no \bv) logical Opeocecoten ' CY) Sel Opeeederes, ) ol! FROM mca stedlenls —— | je (1) Aritumetic Operccitons: (@) Urnewey | 24] SQL SELECT roll, Nama FROM Mea. Gtodent s COHERE mantle 764 rol Dn ot | IYOTI 1b) Binary Ctr) Qs] SQL SELECT rell, Mak +) FRONT Mea—Students [rot | \y at Een as ey | AR 0 Ve IN Character. Operctor’ Chorercter opetertor, arg Used AD een ipudcete Strings, “the emost COMMON Chartocler Operector tS “Ke Concalenti. CI) epertatort . ab} S8L SELECT ame [] © hay smaitks NT] marl, FROM mea students mane {I " fa) Compardsion operations | G@) — @) <= GF) mm: Spal to omy emembor NA Sef #) cor epee well A okbotes§, FRom mea_students WHERE addres gtuCteese’ ) ren |e mame | ddacto> 5 as | Devpay | SBS yy Var im (@ alt: compares a Ust belweer mand 4 W) Gre = mectches “he petttercn of Was reaches TV) srrarcles, ANIMESH Hoes martls 8 “WYOTIN 0s vars AD equ |nnpnle into adSingle rox - 4 from bet) @ UNION - Returns ol digtinct mews from Guerre . S6L*- SELECT meme, aman, FROM meq Studies WHERE marl, 77S ONION al Seuect name , mew ll FROM AACA students ' HERE — addeeess -kGONTHAP Outi MMC carly ANIMES of | DEEPAK 8 s syort_ | 9 KRUTIBANDH| oo 1D) UNION AN Reluans rtoos from bath Gueries Cincluding duplicate rows) 3. ol | UNION ALL toherte = SKEON THAR! J conc, _ANINESH JYot| HROTI BANDA DEE PAK : kRUTI DANDY SELECT Hamme, mak FRO SELECT snome , HUT FROM am ce Stedtent S In amce_ Students Chee Muth) MLO Si 0 8) BS Ss) 39.] SQL—D SBLECT Terme, mascl, FROM “mea Stlemts (bene tenth y4 BD! cat SSBLECT name rat, FROM rncastedents Whore “rath 245 EE CVPrersect ~ Rolueens all sous selecled by oll, qusties (Coron POWs) INTE RSHCT SELECT name, marth FROM mco_ students Where odtrwys | = ‘Besa! | IB) Minus — Returns ot disininet reows Hot are inthe | Rest Auer oud not In the second one. NINOS SELECT nome martle FROM ence. Students Where address = ‘gace I \olotsect % ome nar, DEE PAK aS

You might also like