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

Cs SQL Program 3 and 4

Sql handwritten best programs awarded by NNBHS
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
27 views

Cs SQL Program 3 and 4

Sql handwritten best programs awarded by NNBHS
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 12
ey q Genre the empl gar date, Ls? compat fhe-ralarny based on Depart a) Cveale anemployen ferble by 4llsring ——}~ 1 Nee | Fratd nana | jalalpe ~ | on | Empid | nomborK. qt) | | Deptid | nombor (2) | | | | emp name |vouhe2C28) jfalory Sy | ee ae a ) b) Create ano ther tube department with f | stro dare. | Deptid Lee ay Peportmarst | nomdory | isapencime. |ewxrcho*Ge2.0) va [Hep va rchon2 (1p)| YE Brso me depovtments ACM BAS accounts (id -9 2) 5 sales(sd 0) 2) and op , Creo) > : 0) Enon to voug ot data Foi emplo d) Erber 40198 of able, daded Tos department 1 lahl & 0) UTh Fhe names ea all employees uUheo vor fey tho accounts department ° *) Hos bnulnay omplogess wovles Fer accounts department I 3) whch The minimom, sree mon, canal average calory of emploglis? Ho ring fos accounts department A) cs Hho be an eat vorlcing Aa pale aa ae copa tn 23 5 Potree the ATE Re name era, ook ea one dep employee vovley 2 a) ey: the sal Daas ll the salog nail Add anew column re) a led bo “of 94, ~ | deptid pumbar (2), nama varchar 2 (25), sal arte Rumbo (é))! . i) Command fe create. department tabel 38 L? create fable dept (deptid numb onlay | drame varchar 2. (2.9), Hop perch 2-(20))g 9) Command fe vnsort (0 vors8 of dale fot Lomployee fable ' rau tasert inte employee valood G58it > ‘Avun’) 12.000)} Favs inserk into omploy@ slob ae Gps DhiLip 2 2500 bit ae ince inte empl og- uae aes ‘Sandhya , IDOO)s SQL> taeet insert into employee i 2, "Vivek? 28000); SGD insert inte employe values 520) ‘Mohan’, 36.000) 3° ce Oa into employe selves 66503 "David’> 1HGOO} ‘sour incase indo omplogat uals ‘Chandi Rep OS®) 5 a Tacainre t EQ emp oye, va ow ee 1 Shevry a )9000)5 ee CS innoct ino employer evaliias (504 5 Sharan’, 6500)'s Q ub ad ‘into ‘employ ee whet | Sanspia &.3%00)3 2) itammandts inner ty ren of dab a depanmeat teble, {QL insert ick dept ua lows (oy Ps ‘Sokesh s : | sQLQuiasert = ‘det va tse neal Cyyshal)5 - : c ones voluss (03, ¢ al. omar), ! ; ‘faL> inserP- into. -d ept walu.es (64, . Tavs kram>S- °) Comnond to et whe Loevk SQL? seleh pe | RE dephid= xl select adephid rom, where dnamesA@onby$ 9 1 | LOommand be. find the no of ones ‘she work fer ‘accounts qepartnen! SQ\> selech count (x) from omploqea why | Spphd=(soloct dophd . from, dept wh de dname= ‘Accountr.5 : 5) Command feo tind MIALMOM ) We MarciM and average calaries working accounts department gle e-select min (be salarg) fomemble ee de phd = Csoloct dephia from ‘dept ‘ > chore daamex! “A ctounts Weordorbag (olor) + y Fal > sect moe( salary). from employ : pa ephrd s(solect deptid from dopt | hare dnames’p Bonks Deter, (calarg); ae ay in from employ ea iol {ape , empl “pobre | deptid = (select dept + From dept ='solcash”); vom. emplogec eS pee ye sate iJ command fo yetr) eve the cuties nama | far each dept Lahore ‘only one no Ro |r L>seleth: sdnama_ from dept where. dephid in (solect dephd from empleo gad greuphy kcephid havin 9, coont(e) = a \) Conmay increa 42> the sol Employ inthe soles cf SaLreplate employee set calories = 9h art salary t ols g whore dephd= (select de from dephid where draam2> ‘Sales 5 ) Command to add a agiero (umn to the employ@ called orspees- aumb on (6) te Sy. of the. saloruy " | Cie a Se | be a LAF (veala Coe ee ee bransach on: freqte the fabl e bere A lasing strocune, ee i SA ee Sere Deseriphion . Customen account i . numbers quarch a2 (23) Customer N@M2, Nolune ot the actoont : Balance, amount in the account {peta of Trensachan balance ameont 5 mere than 3 ea 3d) How BREA tae cut fomers ohese bala lan: Gh amount 5 129 Span minimom tA 3 Mepeet CArsoma mA beilance > og Perform frantockion on TL type. (Dep | ital) : - eine Fran sa ctiors amoort on op 3] Duiplog all the recoyds 0 tA. (cuore : beter : *y Command RR ane Lhe hes oD creake lable bam & Gaede Accnd : nomboni[ 12D, totnone baichen2 (25), : Acchape chan Cz), bale number (12); dot hderhes EAReonpeint nombor (12) ,F Hype char b) Command fo inst (0.50 records, Westteas 1 table ig Lo insert into bank valuas( 1230038 ‘Sohon’y “§3945005 ‘2-Bpr-2022’, 3060 BAO) > ; SQ ees iAte-bark valuzs(/23016 | Shanthi? 58, $000," (0- eae ee . op)! ae Heened vale} bans oan daa Tanah» SB 10500, ‘Re Apr-262 45.08 ae PENI Cs sree into bank values (| 123003 35): - a'Surrukhe y eh Leoore | ANE ORas bh Apre- 2022’, $5000, te ; j lsaupinsout - into bank salle (1230133), Cede see 139800, T0-Man- 202, 25008 ay) Sum insot rato bank yalo63C123 0321, Maya’, "5B" 2US00, ‘I2-Apr 20325 HOBO, AD : EO SO inset ne banks vile oe “$ojan JRakisoo'y Az ‘Apr- 20% 14.0000, ws hat HNO ae inde bank vale 1224563, oe (}9-Apr-202>, YO0005' AON oy ny S SQL> nsok inte bork vals (12333008), Iyeona?s ‘SB’, 700) '10-Apr= 2022”, | 3Q00 Ne OU et ela Dat hls ayines « Lreitetincolb tal bank unlaes( 123 3308 Pinay Ge yp ugoo, ‘opr aa de ees OI fomana bs Baa the names , ofall ec 62. whee hulance amount b mere thant 3 SQ L2 re solect ¢ fron bent vhorg bal 7 2000; ) tommond Bew Were thera! amoonk wy |ovs than tha minimom In ! «(COon} HH) S@Ld400leck mace bank hore be ‘Command to perform Me france chen, ! tp Thy pel Doposi K/coith ra. $gL> update bank

You might also like