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

Holiday Assignment (CS)

CS assignment

Uploaded by

Rekha das
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)
10 views

Holiday Assignment (CS)

CS assignment

Uploaded by

Rekha das
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
You are on page 1/ 10
————— - oe ray) a3 i jj te y } cre A 4 | priol (Cac) ane Ce == a) and Cool Co<5)))> + (sa) acba cy tac ta+d a i 7 | Cif bey ces dean) as = ; eee ee Sst i fen oive Ihe uel pod of Jhe fattosing “woh ee = | -numd 244 num2= 35 PLmesas —- pt 1 (a, -oums ound +00m3 Priol (roms) [ (2) nmi sound 14_Covma + ove 3) painl (nent) | fe, _numd a4 = Duma +903 —— ye 1 (2), nvmd_= 4 pas” eit 1 prefod C nud) | (eo peiod Cy-oed C20 +2107) - | _ovmt = 2494 Cesvia) =8)/10 | | priol (ous) Me (Prod Crema 8 | (a), ovms eof INIA 14 ound = $loal Cio) prind (numa) oe | tO nem = tot Cia) paint ¢ oved_) > = 8 |G) priol C11 _th) pool (10 AOD [cb prick C Sefe1e + RSAP and) 296°29) | Ci) | print Lose) sort Cnet Cy 26) one) £10 <0). dow [asf = — ; | amt Jouma ee zd — | os 7 = = 364 womede the one crample of following lemms -———— TG. édeobifien 09 puneadon re Kap oer {% conslant —_—— \ i le PASE NO. | ee coe l- | connect he Canoft ae ae co the _4 eters 2 | stalemeo4 —— | (}atse? Cotes abacrd i asap S preind ay _ je names en (ew) © pohal_eottt be The oulped of the fatten’ Dame = * Rehut =H ls #1a Creme.” 4 5 the stedeal ef cles! cle clas). 3-1 coheed “will ‘be, Ue celal “of athe fata Lab = do, 6 | tees be ey ve Sat Py mn, -q eath,b-2 : a \\ Re ae . te tad _|| eee prial CMa. a Tm goa ES oD a Corcnecd he Fonaiey coale. . an bin (Oma=5 ‘ 4 ge aie. x Printen) Ei prio (ay (W) subs “math” + teint 1 nt bey ee manks = BO - Led Fy 5-| Deleamine whieh of lhe Fetaing 2 vatral, ef snyatrel , explain eoclh “re asoo + (0 deme. d CMD fsven (¥) name Dd _sem (&) numa a 7 spol cool be he ouput of [he fonsvigg 2 jae _ a ie | print Chas tayo == == | prio (tba th) ae ertpeenion for the — To. cornide the coneapcr — Replhon _ | founsoing moclhemalical Super L iO atb-d° () x= ee sey ] re), hal ill be lhe vate of fe ef ata 2 (CO C12 +a) 3 (Gr +8) % 4 ' 27 (eB canta 48) *he 3 ye wa [fay prevelicd he output : haat 4 |(o_a23 - | > fm a be td 10+ a beG@uz_ : “ce ab pyre preset (ada teh) d= cr te I i- / printed y 1 pol Ces Sk eee : 7) a ; 4 |e py ee eta “prin Co y=b) oe COC==b) and (nol (C<4))) ih fi ae : - T patos roe cer a)ane| (ae Cel ce ae — o med (a a=2 ae “preinl. Cs ete fae rerot_( aS ca Bees te ful Cay _ pret. Cay! a Ley 7— priol € tage Ali, _ prea C adj PAGE No. (Date: ao - oulped To et a cel —_ _ while (6c S$) Ee : Pein Oe) ee 4q | 1 ares = _ (fore ¢ to range (0,501) _ 0 for ¢ tn in nedle C1, $0, 1) 3 Ho ] (0) fon f én 2 fo,A It - et - tiv) for ¢ in Co, ee - stay ef Cae : prio (" “forly foun) Shswat = ee else * _ jriol C'none’) | ity Ph coy prcad (' Keno") +) cP Cio 2 = 5): ! c pia (“equal”) | etre | .e prind (“nel capa!) at ! ai = | _ Mel wr 13 _ — | fon een me f a 7 4 | pial C4) ll dno hele loop ib _. . |e) converel fe following tooP || on kK ea mae ce aoS) 5 sowies inte fon Joop _# while leep a7 $= Convers! tk foriosing ! ci) 1, a, 3,9 - — | fu 1, 3-5 ~ 4 fw) 4,3, a) = a J | (fw) 4,823, 1 —— es mt J-torasp to prenl 1 lo 10 ose "ng fon Veep 8 | waP lo prea lable _o of number seq _4- Feng -the ston an lhe fering a” pale an ane conned the Coole ha rarer] g ol? are undlenke (Dre Connecdon & asin Clenlen« abe vakue fe we") 0 range Cs Co, — CS at rE ee else : Le a \ as tor, fore ¢ eo [rag : ~ preiot Ccepu", ¢) n-| fore 6 9 (t0ey Roo, 300] * prio ce) tas, for yen ay ange C0, ea)! 4 _ prist (ita ) a ye for oe ca range Cs) | - fon ef ch range Cl, 7: peel Ca a) j — _t4 | fen éo ws Qoji. = u ee is)t _ Po break | pred Cx) __ is~_for %_¢o ai 32) —— 22 4 “if foes? a E . |e content priate) wo! fiw yes: - preiod Con’) — a > efoi1 >60: a _ = pre tod 1 c'ged”) et ee clef a > yo: aes peo C" tavensy else a mo - pea Cov ool pet” ) _ a Fewliorele he ou pot ef lhe oni cole he exceed | mare @)com" _ a en Chex) | adend =") non fon _¢ tn mange (0,0 )- cP Te fe] csuppecc) : Ailend = Ofexl + rext le] - Cowent } elef Teale]: Cratpha ¢) next = ofenl + Teel CéeT-vpperct) £1s0¢ Aden =odext + ‘bb’ print (ntext ) _ “16: sa plo print fore fébonaced senres anny | hile loop > q —4 ie rasp do Fin} dn _faclemrat of a geen Qumban - | act oo asp do. clit pla | a _-friangje of numbers vsene | fon teep_ wilh iste. a “ehele“Neop = a. Ale write a Preog nom fe dean pref (6) eet nell numbers’ -from 1 le Qo - UD _avmbent 5, jo, (§ And cd onlay fel Se: 29. Write SQL Commands/output for the following 0} (ii) (iv) w) (vi) 30. (a) (0) (c) Table: FURNITURE a a Gree Whitelotus DoubleBed 2002-02-23 3000 Pinkfeathers — BabyCot_ 2002-01-29 7000 * Dolphin BabyCot 2002-02-19 950020 Decent OlficeTable 2002-02-01 2500030 Comfortzone —DoubleBed 2002-02-12 25000 30 Donald BabyCot 2002-02-24 650038 To list the details of furniture whose price ts more than 10000. To list the Item name ond rice of furniture whose discount is between 10 and 20 To delete the record of all items where discount Is 30. To display the price of ‘Babycot’. To list item name, type and price of all items whose ELECT DISTINCT Type FROM Furni tur SELECT MAX (Price) FROM Furniture WHE SELECT COUNT (+) FROM Furniture WHERE Discount<25 1n the basis of the given table GRADUATE: names start with “ "2002-02-15" FE DateofStoc Table: GRADUATE A Sil eet KARAN 400 PHYSICS Rad 450 CHEMISTRY oe DEEP 300 MATHS 62 DIVYA 350 CHEMISTRY 63 GAURAV 500 PHYSICS 70 MANAV 400 CHEMISTRY 55. VARUN 250 MATHS 64 uza, 450 COMPUTER 68 PUIA 500 PHYSICS 62 NISHA, 300 COMPUTER 57 2 List the names of those students who have obtained rank 1 sorted by NAME. Display a list of all those names whose AVERAGE is greater than 65. Display the names of those students who have opted COMPUTERas a SUBJECT with an AVERAGE of more than 60. List the names of all the students in alphabetical order. ELECT * PROM GRADUATE WHERE NAME LIKE "8 I 3"; SELECT DISTINCT RANK FROM GRADUATE; What is the difference between Candidate key and Alternate key? What is the degree and cardinality of a table having 10 rows and 5 columns? For the given table, do as directed: Table: STUDENT Enna es Se eae) ROLLNO integer Primary Key SNAME Varchar os Not Null GENDER Char 1 Not Nutt Dos Date Not Null FEES Integer 4 Not Null HOBBY Varchar 15 Null (i) Write SQL query to create the table. (ii) Write SQL query (0 increase the size of SAME to hold 30 characters. fii) Write SAL query to remove the column HOBBY. (iv) Write SQL query to insert a row in the tabl h am can be jccommodated there. le with any values of your choice that ca ga. were SQL queries based on the folowing tables: Table: PRODUCT SE 40 rpot Tolcum Powder LAK NULL wos Face Wash ABC aS soi Sath Soap ABC 55 NUL sHos Shampoo XYZ 120 10 fwi2 Face Wash XYZ 95 NULL Table: CLIENT Go [in 01 Cosmetic Shop Delhi = TPO1 02 Total Health = Mumbai FWOS 03 tive Life Delhi S01 04 Pretty Woman Delhi SHO6. 05 Dreams Dethi — Fwi2 {i) Write SQL Query to display ProductName and Price for all products whose Price fs in the range 50 to 150. {iy Write SAL Query to display details of products whose manufacturer Is elther XVZ oF ABC. (ii) Weite SOL query to display ProductName, Manufacturer and Price for all products that are not giving any discount. (iv) Write SQL query to cisplay ProduetName and price fer all products whose ProductName ends with {o) Write SQL query to display ClientName, City, P_ID and PraduetName for all clients whose city is Delhi. (ui) Which column is used as Foreign Key and rame the table where it hes been used a5 Foreign key. Answer the questions based on the table given below: Table: HOSPITAL 2. ae 1 Arpit 62 Surgery 1998-01-21 300 M 2 Zareena 22 ENT 1997-12-12 250 F 3 Kareem 32 © Orthopaedic 1998-02-19 200 M 4 Arun 12 Surgery 1998-01-11 300 M 5 Zubin 30° ENT 1998-01-12 250 M 6 ketaki 16 ENT 1998-02-24 250 F 7 Ankit 29 © Cardiology 1998-02-20 800 F 8 Zareen 45 Gynaecolory 1998-02-22 300 Fr 9 Kush 1s Cardiology 1998-01-13 ‘800 M 10 Shilpa 23 Nuclear Medicine 1998-02-21 400 Fe (a) To list the names of all the patients admitted after 15/01/98, {b) To list the names of female patients who are in ENT department, (c) To list the names of all patients with their date of admission in ascending order. (4) To display Patient's Name, Charges, Age for only female patients. (e} Find out the output of the following SAL commands: poseenals ne een FROM HOS T(pIsTIticr Charan : we; -_ their inventory using SAL to store the data, ayy aintaln [CBSE Sample Paper 2020.21) (i) seLEec (ii) SELECT MIN (Age) FF 33. A department store MyStore is considering to database administrator, Abhay has decided that + Name of the database ~ mystore + Name of the table ~ STORE The attributes of STORE are as follows: ItemNo = numeric ItemName ~ character of size 20 Scode ~ numeric Quantity ~ numeric Table: STORE | HteraNol rtemName llama] Scouel| eum 2005 Sharpener Classic 23 2003 Ball Pen 0.25 22 0 2002 Gel Pen Premium 21 150 2006 Gel Pen Classic. 21 250 2001 Eraser Small 22 220 2004 Eraser Big 22 110 2009 Ball Pen 0.5 21 180 (a) Identify the attribute best suitable to be declared as a primary key. (b) Write the degree and cardinality of the table STORE. {c) insert the following data into the attributes ItemNo, ItemName and SCode respectively in the given table STORE. ItemNo = 2010, ItemName = “Note Book” and Scode = 25. (d) Abhay wants to remove the table STORE from the database MyStore. Which command will he use from the following? (i) DELETE FROM STORE; (ii) DROP TABLE STORE; (iii) DROP ‘ABASE MYSTORE; (iv) DELETE STORE FROM MYSTORE; (e) Now Abhay wants to display the structure of the table STORE, /.e., name of the attributes and theit respective data types that he has used in the table. Write the query to display the same.

You might also like