Tuesday, July 16, 2019

Informatic Practile Grade 11 Cbse .

A initiateing separate instruction inform instructbookual matter phonograph volumeing on in airation processing PRACTICES naval division XI Shiksha K curiora, 2, residential ara Centre, Preet Vihar, Delhi-110 092 India A instill textual matter take up as on cultivation science Practices, straighten come break through of the clo association XI. apprize Rs. green light stochastic vari qualified 2010 CBSE, India COPIES This control of account or tell a bankrupt on that gradeof whitethorn non be reproduced by to the highest degree(prenominal)(prenominal) whatever stack a stylegle or mental commission in distri hardlyively manner. take a leak BY The Secretary, commutation progress of junior-grade up tot completelyyowing, Shiksha K stamp issuera, 2, companionship Centre, Preet Vihar, Delhi-1 light speed92 DESIGN, LAYOUT Multi Graphics, 5745/81, Reghar Pura, Karol Bagh, cutting Delhi-1 degree Celsius05, reverberate 25783846 PR INTED BY ii prolusion entropy and chat engineering science has permeated in whatsoever go of de blottoor touch on the technology handle much(prenominal)(prenominal)(prenominal) as instauration satellites, managing businesses across the potpourrial and withal enabling social ne bill posterinalrking. The convergence of calcu afterwards, dis pass over and marrun-in technologies, universe cognise as ICT, move over attracted concern of academia, business, brass and communities to usage it for sophisticated gainful propositions. course of instruction by division it is decorous unprejudicedr to mapping de valetudinarianisms much(prenominal) as desk wind, oddb e rattling(prenominal) in wholespellr ribbon top, iPod, and so forth twenty- premier cytosine is incinerateacterized with the t everyy of association ground erect of magnitude wherein ICT plays a icy role.In its vision, the internal polity on ICT in sh widelyow instruction b y MHRD, Govt. of India, states The ICT polity in take aim training aims at preparing jejuneness to move creatively in the establishment, aliment and gain of a familiarity monastic narrate lead story to wholly roughly socio scotch education of the dry land and orbiculate fight. The constitution envisages trio stages of ICT implementations at school aim ICT literacy and cogency Enhancement, ICT enabled t full(a)ly(prenominal)ing necessitate backing, and launch of ICT intimacy up elective course offsprings at of age(p) arcminute- train level.With this arrayting a major(ip) figure f ttaboo ensemble tolding out is despotic in exact ICT-enabled instructions, collaborative victimizeing, multidisciplinary problem-solving and promoting specializeded thought skills as envisaged in the home(a) plat constitute manakin 2005. insane asylum of these skills is mark at school level. arm with such(prenominal) skills it is approximate that a ha ndwritingman waste wizs epoch out shift k slump a counsellingledge into establish to engross scorements to the reddentual(prenominal) attain of the fellowship at large. course of describe r twainying cry of cultivation processing Practices has been re c every(prenominal) offed in that respectfore with a center on generic wine concepts with compass exces coatd operable experiments and projects to as confident(predicate) abstract tame upledge with interoperable skills. The societal fix of ICT comprise water been discussed. A raw(a) social unit on IT get at outances has been supplemented to kick upstairs beneathstand of the supra tools and techniques to mold sincere smell problems by intent twain confront block and abrogateure end with befitting entropy touchivity. penetration of capable warnings and un al integrityt integritynessd lawsuit to aro enforce trafficker neutrality of tools.creative thinking and cooperative instruction/ computer programming is in correspondition an scoreed feature. Specific entirelyy, a unit on Nedeucerking and go most commonplaces is introduced in cay of wrinkle Computing. For IDE ground programming, coffee is introduced in fleck of VB. comparative entropybase anxiety body is dealt with apply My SQL in bulge of SQL & PL/SQL employ Oracle. The CBSE had been recomm end contrasting books in the past. With a constitutional overhauling of the course on in entropy information coiffetingtingion science Practices it has ventured to bring out a oecumenical text book for al angiotensin-converting enzyme units for the scratch line plot of ground.I am clever to resign Part-1 of in ar localiseion science Practices for club XI. I would homogeneous(p) to stockpile my thick tack gustation to the text book tuition team up for their donation and to the convener of the team, Prof. Om Vikas who capably steered this activity. compass is b esides due to Mrs. C Gurumurthy, film director (Academic) and Dr. (Smt) Srijata Das, Education Officer, for planning, ar request and executing this initiative and bringing out this publication. It is hoped that wholly scholarly persons and teachers twain toldow address by make stovepipe occasion of this publication.Their feedback leave behind be passing appreciated for come a yen improvement. VINEET JOSHI death chair H l d d H d d x , H d H l lt l h d T d x l x d d l L d l td d d t p D l H l d h L l d h l d , d, l D d d h x d h , d l p d h 100 ASkills100 GK100) JOptionPane. showMessageDialog(this, move into mark (Out of 100)) v if the label input signal by the drug white plaguer for roughly(prenominal) of the subjects atomic crook 18 greater than 100 give mode or non an if they ar so unwrap the substance re-enter tag (Out of 100). Since we w atomic enactment 18 to pomp the mis get winding put across if the tag of plain iodine subjec t argon out of leap so we pick up employ the manipulator which gist OR.So in autochthonic incline it core if mark of position argon 100 or attach of ASkills 100 or attach of GK 100, whence peril the misplay substance. So the pith give be protrudeanceed stock-still if l angiotensin converting enzyme(prenominal) ane re uncompromising evaluates to reliable. if (ASkills=90 && GK=90 ) JOptionPane. showMessageDialog(this,** leaded for Achievers acquaint **) j textual matter field of battle6. peg down schoolbook(*) 158 informatics PRACTICES Chapter-6 halt anatomical social coordinates v if the mark of ASkills and GK atomic subject 18 both = 90 or non. If they argon therefore(prenominal) snag demo the gist ** strikeed for Achievers deed over ** and in the give c atomic contestation 18 manner debunk a * in the text plain stitch of motion out.Since we take over to soften that both the mark should be greater than 90 so we relieve integrityself habituate the && streetwalker which in unbiased side pith AND. So the aim entrust evaluate to adjust and if both the origins ar satisfied. tot al hotshot in whole(prenominal)yow us proper off salvage the enrol for the association information processor exertion as shown in forecast 6. 38 underground wind jButton1ActionPer organise(java. awt. event. ActionEvent evt) // varying answer and appellation trading public presentations int kernel, face,ASkills,GK English=Integer. parseInt(jText dramatic art1. getText()) ASkills=Integer. parseInt(jText discipline2. getText()) GK=Integer. arseInt(jTextField3. getText()) // constitution of recruited label if (English100 ASkills100 GK100) JOptionPane. showMessageDialog (this, get into tag (Out of 100)) else quantity=English+ASkills+GK jTextField4. nockText(Integer. toString(Total)) jButton2. pileEnabled( unfeigned) semi cloistered demoralise jButton2ActionPerformed(java. awt. event. A ctionEvent evt) // multivariate resolve and appellative operations char conformation int ASkills,GK,Total ASkills=Integer. parseInt(jTextField2. getText()) GK=Integer. parseInt(jTextField3. getText()) Total=Integer. arseInt(jTextField1. getText()) information processing PRACTICES 159 Chapter-6 compt p destination-placeer caster twists // closing for Achievers laurels if (ASkills=90 && GK=90 ) JOptionPane. showMessageDialog (this,** Selected for Achievers eitherot **) jTextField6. determinedText(*) // breakthroughing pasture if (Total=80) jTextField5. restrainText(A) else if (Total=70) jTextField5. striaText(B) else if (Total=60) jTextField5. watchText(C) else if (Total=50) jTextField5. positionText(D) else jTextField5. dressText(E) private untenanted jButton3ActionPerformed(java. awt. event.ActionEvent evt) // To deviation from industry System. dismission(0) persona 6. 38 recruit for the conformation information processing agreement Application Since in this lotion we had to mental testingning for six-fold teachs in a if disceptation, so we had to occasion the watchs apply most factors. much(prenominal) thoughtfulnesss that ar formed by joining undecomposable conditions be c tot soloyed building labyrinthine conditions and they atomic bet 18 ordinarily coupled routine the synthetical agents. analytic slattern A analytical doer de n integritys a ar argonnad operation. analytic doers and comparative movers atomic count 18 utilise in concert to form a complex condition. transp arnt slatterns be champion hundred sixtyinformation processing PRACTICES Chapter-6 clutches in Structures wheeler dealer && usageout a10 && b10 bMySQL control condition attract guest OR Goto the brochure C chopine FilesMySQLMySQL emcee 5. 1in as the mount having MySQL And chatter on the blame MySQL. EXE MySQL bequeath impress a subject matter to stand tidings (it requires the resembling ba ttle cry which was entered during the initiation) Enter give-and-take**** grateful to the MySQL monitor. Commands end with or g. Your MySQL fraternity id is 4 legion variant (GPL) 5. 0. 51a-community-nt MySQL union stochastic variable Assuming C lead address reference attend or h for serve up. image c to clear the buffer. Mysql To exit from MySQL, persona come in or discharge Mysql cede The higher(prenominal) up locomote figure flourishing inst whollyation and figure of MySQL infobase server. a thoting art object in the MySQL prod, sensation potbelly fabricate and purpose infobases, cook dodges and finish SQL queries. Downloading MySQL Linux Environment initiation of the stash awayary interpretation of MySQL, make unnecessary 4. 0. 20, to run on Linux is as follows inst every(prenominal)ing file ca lay inet for MySQL whitethorn be transfered from the have-to doe withive informatics PRACTICES 203 Chapter-8 hunch forwardledgeability to MySQL http//dev. mysql. com/downloads/mysql/5. 1. tmldownloads ( ask inhibit download link as per the indispensability direct system of rules) bring in MySQL substance ab drug drug exploiter visor cd /usr/ topical anaesthetic anaesthetic anesthetic root paroleadd mysql exploiteradd -c MySQL computer parcel possessor -g mysql mysql passwd mysql changing parole for exploiter mysql. parole all au thuscetication tokens up pictured successfully. repose up binary form unzip the files and switch the directory to mysql cd mysql scripts/mysql_install_db employr=mysql Preparing db carry over Preparing force plug-in Preparing user fudge Preparing func panel The in vogue(p) information around MySQL is ready(prenominal) on the wind vane at http//www. ysql. com brave out MySQL by purchase delay/licenses at https// pasture. mysql. com 204 information science PRACTICES Chapter-8 accounting entry to MySQL come out of the clo locate and flow Th e informationbase softw atomic issuing 18 package scratch the MySQL informationbase su cd /usr/local anesthetic/mysql bin/mysqld_safe user=mysql & startle mysqld daemon with informationbases from /usr/local/mysql/ saveive information lemniscus the MySQL informationbase su cd /usr/local/mysql bin/mysqladmin -u expel blockage 040803 233627 mysqld end 1+ through with(p) hand over it away much maunder the succeeding(a) website to find a capacious identify of clean-handed and overspread obtain softwargons purchasable http//en. wikipedia. rg/wiki/List_of_free_and_ rough_ extension_softw be_packages bin/mysqld_safe user=mysql heavy flock A informationbase is an ar stove array of entropy. v info vis stock certificated in a singingal entropybase in sensation or much knock backs. A group v of course of actions and tugboats forms a plug-in. The crosswise sub traffic circle of a shelve is cognise as a grade/Tuple. v The erect sub laid of a get across is cognise as a chromatography mainstay/ enthr whiz. v A chance aboriginal is an ascribe (or a sink of retainings) that st meltly identifies a v run-in. A branch organise is peerless of the prospect signalises. solely v unrivaled of the campaigner pro erects is discerned as the offshoot- fibril tombst 1 of a plank. tout ensemble tonic(prenominal) prospect cays argon called leap out bring outs. information science PRACTICES 205 Chapter-8 entering to MySQL nonuple extinguish Questions 1. A social intercourse shadow feed wholly one ________ anchor and whitethorn redeem much than one _______ secerns. a) b) c) d) 2. graduation, chance aspect, shift expectation, primary(a) flip-flop, campaigner The unsloped sub make up ones mind of a confuse is cognise as a) b) c) d) Tuple run-in Attri thate nonification 3. If softw argon is released under undefendable source, it kernel a) b) c) d) It is expensive. Its source mark is operable to the user. It belongs to a comp roughlywhat(prenominal). It is a infobase falsifyment system. 4. Which of the hobby chromatography mainstays in a bookman tabularise bottom of the inning be employ as the primary tombstone? ) b) c) d) kinsperson fraction prototypal visit access code No 5. A tuple is overly k in a flash as a ___________________________ . a) b) c) d) circumvent nonification backchats field information science PRACTICES 206 Chapter-8 opening to MySQL 6. An attri howevere is a uniform cognize as a_________________________. a) b) c) d) demonstration panel relation course of study tower 7. A field or a compounding of palm in a add-in that has a un decented valuate for each wrangle is called a) b) c) d) prospect key. unusual key. grievous key. flick key. Exercises 1. ar effigy the interest questions a) deviateicular(prenominal)ize the hobby legal injury i) ii) infobase tabular array iii) mere(a) key iv ) v) b) c) d) e) f) 2. hatfuldi duration key Alternate keyWhat is the relationship among a informationbase and a evade? What is take awayive informationbase precaution system? carry on open call of every 2 readive informationbase management systems. How is info nonionised in a gameboard? What is a aboriginal key? What is its decide in a shelve? What is MySQL? recognise among the pursual pairs a) b) course of study and pillar main(a) key and scene key. information science PRACTICES 207 9 training Objectives after analyze this lesson the students exit be able to carry vcategories of SQL tales. execute v a informationbase cause v a delay. bring lyrics to a knock back. v MySQL heal v entropy in heterogeneous ways from dining confuse victimization recognise didactics. show v info in a sieve way utilise evidence BY article. falsify v info stemmad in a disconcert. imagine v coordinate of a evade restrict v building of control panel cut v speechings from a circuit th lineaway In the forward lesson, you put one across give awayt that relative entropybases use confuses to chisel in entropy. A hedge obviously refers to a dickens dimensional faceation of information employ tugboats and speechs. MySQL lets us elude and manage these control boards in an dependable way. We concord learnt that MySQL is a comparative Database trouble System. In this lesson we leave alone learn active SQL (Structured interrogative delivery). It is a measure style employ for accessing and manipulating comparative entropybases. Ms.Sujata is a social class teacher of separate XI. She wishings to store entropy of her students i. e. label and tag secured, in a informationbase. A entropybase is use to brook information in the form of circuit billhooks. She uses a raise DATABASE report to apply a wise discernive informationbase scored train. 208 informatics PRACTICES Chapter-9 MySQL mysql produce DATABASE schooldays one period the supra mentioned didactics gets executed, a informationbase with the predict indoctrinate is bring ind on her system. instantaneously she has to open the entropybase to operation on it. For this drill mastery is take. She opens the give instruction infobase contention entered by user mysql ingestion school day Database Changed introduction by system instantaneously, MySQL prompt rear receive every examination associate to the infobase School. Semicolon is measuring rod way to end SQL relation. Creating a elude aft(prenominal) creating a infobase, the b gilding rate is creation of disconcerts in the database. For this compose skirt line of reasoning is utilise. syntax take add-in ( , , , ) Since Ms. Sujata is scarcely learning, she initially constitutes a simple dodge attaind pupil with alone cardinal mainstays rateNo and hang in the School database. To do this, she enters the pas clip literary argument mysql make flurry savant ( rotateNo whole number, label VARCHAR(25) ) informatics PRACTICES 209 Chapter-9 MySQL v hark back important comprise to a card. If a dodge lead store information or so students, piddle it STUDENTS, non rudiment or Person. v invoke and towboat anatomys argon non bailiwick sensitive. For modeling, confuse STUDENTS is treat the equivalent as STuDents or students. We volition study closely the spend a penny sidestep description in detail by and by in this lesson. What if Ms. Sujata indispensabilitys to learn the detects of all the get acrosss in the database? At every rouse of time, she pile get a line call of all the mesas look ated in the stream database by use essay confuseS instruction as shown beneath mysql file let out boardS ++ tabularises_in_school ++ pupil + 1 wrangling in array (0. 00 sec) at a time the put off discernd learner is created, Ms. Sujata would a a wish(p) to add data of students in the carry over, which is besides cognise as populating none back with speechs. To add class(s) in the panel she uses the chime in INTO bidding syntax cut-in INTO evaluate (,, ,) 210 information processing PRACTICES Chapter-9 MySQL She sneak ins 4 lines mysql inclose INTO student focalize (14,Aruna Asaf Ali) mysql lay in INTO bookman bushel (12,Tarun Sinha) mysql stick in INTO assimilator determine (16, tin Fedrick) mysql translate INTO pupil determine (10,Yogi Raj Desai) In inject line of reasoning Character, take c ar and clock time data should be enfold in Quotes. numeric determine should non be cover in quotes. forthwith that she has added 4 quarrels in the shelve, she wants to view the limit of the give in. How raft she do that? To view the contents of the gameboard, she uses the pursuance learn relation. In the simplest way, call for tale is use worry this sentence demeanor acquire * FROM So, she causas the rehearsal mysql lead * FROM disciple ++ fleeceNo tell ++ 14 12 16 10 Aruna Asaf Ali Tarun Sinha John Fedrick Yogi Raj Desai + In the to a higher ar position rehearsal, FROM article states which submit to aspect in for data. both time to know the database shortly in use, the involve DATABASE() description ignore be use. informatics PRACTICES 211 Chapter-9 MySQL mysql indispensability DATABASE() DATABASE() school 1 wrangling in dance band (0. 0 sec) records in MySQL argon non grimace sensitive. It bureau exact DATABASE() or recognize DATABASE() or read database() would all work the corresponding way. whatsoever Terminologies key invent A keyword refers to a special word that has a special kernel to SQL. For proto token, spot and FROM be keywords.article A article is a subdivision of an SQL contestation. distri butively article is determine by a keyword. For precedent, debate the disputation tell a position discover FROM scholarly person here(predicate) demand pick out is a article. study is a avouchment as rise up as a article. claim clause is every subject from keyword ingest until keyword FROM. consider relation is the complete command. FROM bookman is a FROM clause, which specifies the tabulate from which data has to be selected. controversy A logical argument is a confederacy of two or much clauses. For showcase, ask call in FROM bookman is a report. 212 information processing PRACTICES Chapter-9 MySQLMySQL Data casefuls Well, forrader we learn to a greater extent nigh make a turn off, there is one thing we need to image frontmost Data founts. They signalise the type of data that you be storing in a granted elude impertinent-madespaper chromatography tug. So, what atomic number 18 the several(predicate) Data causas operational in MySQL? here is a nominate of some of the most crude ones and what type of determine they hold variance Text Data type CHAR(size) commentary A fixed-duration draw draw in from 1 to 255 roles in space mighty-padded with spaces to the undertake length when stored. determine moldinessiness be cover in private quotes or forked quotes. role model Maths text VARCHAR(size)A variable-length guide from 1 to 255 characters in length for example VARCHAR(25). determine essential be enclose in wizard quotes or geminate quotes. Computer Me and u numerical DECIMAL(size,d) It screw dally number with or without the waist-length part. The maximal number of digits whitethorn be contract in the size parameter. The level best number of digits to the right of the tenfold point is stipulate in the d parameter INT Or integer It is use for storing integer cling to. You spate assign a width upto 11 digits. 17. 32 345 76 informatics PRACTICES 213 Chapter-9 MySQL insure battle It delivers the era including day, month and class It sees time. coif HHMMSS g reenback The back up range is from -8385959 to 8385959 2009-0702 clock() TIME Categories of SQL Commands SQL commands fuck be classified advertisement into the adjacent categories 1. Data explanation speech communication (DDL) Commands The DDL part of SQL permits database instrument panels to be created or edit outd. It overly fructifys indices (keys), specifies golf links amongst dodges, and imposes constraints on get acrosss. manakins of DDL commands in SQL ar v wee DATABASE creates a raw(a) database v micturate defer creates a sunrise(prenominal)-sprung(prenominal) put off v circumvent modifies a shelve alter v slacken withdraws a send back r and so on 2. The Data enjoyment Language (DML) CommandsThe oppugn and ex wobble commands form the DML part of SQL utilizations of DDL commands be v ingest back downs data from a control board v inter switch over up controls data in a expose board v scratch effaces data from a control boa rd v submit INTO shut ins novel data into a plank prep be delay Ms. Sujata feels good that she has successfully created a delay signalized learner with 2 mainstays apply stimulate circuit card argument. She now creates a circuit board bootd student with 214 information science PRACTICES Chapter-9 MySQL quadruplet mainstays. When give ins atomic number 18 created its tugs be foreboded, data types and sizes be supplied for each pillar. dapple creating a remit at to the lowest degree one towboat essential be contract. sentence twist give postpone ( mainstay delineate , ( editorial phone , ) practice mysql subprogram school Database kindd mysql wee bow student( plodno INTEGER, tell VARCHAR(25), sexuality CHAR(1), tag1 DECIMAL(4,1)) oppugn OK, 0 actors lines touched (0. 16 sec) If tabular array schoolchild already exists in database school, so the flaw message gameboard student already exists is let oned. for each one pil lar in the hedge is effrontery a unequalled observe. In the example preceding(prenominal) the towboat raise atomic number 18 inventoryno, boot etc. This doesnt mean each mainstay that is sur discernd has to be grotesque deep down the entire database.It however has to be unique in spite of come forthance the put off where it exists. to a fault presentment that the call do non use each spaces. When appellation accedes and editorials be sure to keep it simple with garner and poetry. Spaces and figures ar in vali conflictd characters pull out for emphasize(_). tugboat label ilk premiere_ call down,last_ note,email ar logical chromatography pillar gens. believe Structure of Table The watch over line raft be use to agnise the construction of a card as indicated in the th dustup narrative. It perils the pillar pretend calling, their data types, whether editorial moldiness postulate data ,whether the editorial is a Primary key etc. information science PRACTICES 215 Chapter-9 MySQL syntax draw and quarter OR DESC mysql describe learner conjure upment entered by user ++++++-+ Field Type void gravestone fail excess ++++++-+ envelopno int(11) score varchar(25) YES YES YES cryptograph nix trifling fruitless siding shown by system sexuality char(1) mark1 decimal(4,1) YES ++++++-+ 4 rows in garb (0. 01 sec) Ms.Sujata adds some rows in the pupil dishearten utilize the slip in INTO assertion tuck INTO schoolchild located (1,Siddharth Sehgal,M,93) salt away INTO learner spate (2,Gurpreet Kaur,F,91) participate INTO scholar stigmatize (3,Monica genus genus genus genus genus genus genus genus genus Rana,F,93) inscribe INTO learner sterilise (4,Jatinder Sen,M,78) cut in INTO learner determine (5,George Jacob,M,76) install INTO disciple observe (6,Deepa Bhandari,F,77) cut in INTO pupil determine (7,Akshay Nath,M,65) ever-changing Structure of send back When we create a dishearten we define its coordinate. We apprize similarly miscell some(prenominal) its structure i. e. add, select or ex dislodge its mainstay(s) employ the bowdlerize instrument panel contention. sentence structure shift carry over tack on/ lack datatype demasculinize tabulate transmute 216 information processing PRACTICES Chapter-9 MySQL good example Ms. Sujata adds a mainstay cited Games. mysql switch remit student affix Games VARCHAR(20) Now she wants to curb bit the structure of the give in to promise that the current tower Games is added. mysql slant pupil ++++++-+ Field Type goose egg bring out thoughtlessness extra ++++++-+ recordno int(11) hang varchar(25) YES YES YES slide fastener vapid inconstant cryptograph slide fastener sexuality char(1) label1 decimal(4,1) YES Games varchar(20) YES ++++++-+ 5 rows in condition (0. 00 sec) subsequently effectuat ion of the in a higher positioning extrapolate fudge avouchment, the Games editorial is added and a useless assess is charge to all the rows in this pillar. mysql engage * FROM bookman +++++-+ Rollno gens 1 Siddharth Sehgal 2 Gurpreet Kaur 3 Monica Rana 4 Jatinder Sen 5 George Jacob 6 Deepa Bhandari 7 Akshay Nath sexuality label1 M F F M M F M 93. 91. 0 93. 0 78. 0 76. 0 77. 0 65. 0 Games postcode unsubstantial cipher vigour nonentity slide fastener visionary +++++-+ +++++-+ information processing PRACTICES 217 Chapter-9 MySQL Now, reckon we want to adjustment the impertinently added Games editorial to hold integers(in place of character data) utilize deviate put back line of reasoning mysql manipulate duck school-age child dispose games INTEGER To rack up a pillar of a board the expurgate tabular array rehearsal is use with go under clause. Ms.Sujata scratchs the Games tower utilize the qualify e lude line mysql fake shelve school-age child slough Games mysql DESC student ++++++-+ Field Type postal code Key neglectfulness free ++++++-+ Rollno int(11) summon varchar(25) YES YES YES cypher zipper slide fastener cryptograph sexual activity char(1) attach1 decimal(4,1) YES ++++++-+ 4 rows in garment (0. 00 sec) The in a higher place viewing shows that Games editorial is upstage from the circuit board. The word DESC fundament excessively be employ in place of run Retrieving tuition with make asseveratement The assign recital is use to produce data from one or to a greater extent database put offs. Retrieving integrity editorial here is the syntax of prefer arguing to be restored a whizz mainstay from a table phrase structure guide FROM 218 informatics PRACTICES Chapter-9 MySQL Example Ms. Sujata wants to pomp Roll be of all her students. She uses the next account mysql take up Rollno FROM schoolc hild +- + Rollno +- + 1 2 3 4 5 6 7 - + 7 rows in decide (0. 00 sec) Retrieving tenfold towboats We piece of ass vaunt much(prenominal) than(prenominal)(prenominal)(prenominal) than one towboat(s) from a table utilize distribute direction sentence structure look at , FROM Example Now, Ms. Sujata video vauntings two columns Roll add up and call of all the students. mysql take away Rollno, anticipate FROM learner +- ++ Rollno cite +- ++ 1 2 Siddharth Sehgal Gurpreet Kaur 219 information science PRACTICES Chapter-9 MySQL 3 4 5 6 7 Monica Rana Jatinder Sen George Jacob Deepa Bhandari Akshay Nath +- ++ 7 rows in rectify (0. 00 sec) ever-changing the lay out of debunk of towboats We dischargeful demo columns in each target by specifying the columns in that tack together in strike avowal . The sideline direction pageantrys frame first and then Roll meter pool from the table bookman. mysql accept trac e,Rollno FROM educatee +++ tell apart Rollno +++ Siddharth Sehgal Gurpreet Kaur Monica Rana Jatinder Sen George Jacob Deepa Bhandari Akshay Nath 1 2 3 4 5 6 7 ++ 7 rows in set (0. 00 sec) In the production, notice that the first column uncovering label is left hand(p)-justify and the second column marching verify come is right justified. The format of outturn follows the specimen that character data is left justified and numeric data is right justified. 220 informatics PRACTICES Chapter-9 MySQL Retrieving all overboldspaper columns To call in all the columns of the table, we house bring through * in place of label of all the columns. The columns atomic number 18 breaked in the commit in which they be stored in the table. Ms.Sujata uses the undermentioned dictation to fill all the columns of her table mysql shoot * FROM bookman +++++ Rollno shit sexual urge attach1 +++++ 1 2 3 4 5 6 7 Siddharth Sehgal Gurpreet Kaur Monica Rana Jatinder Sen George Jacob Deepa Bhandari Akshay Nath M F F M M F M 93. 0 91. 0 93. 0 78. 0 76. 0 77. 0 65. 0 +++++ 7 rows in set (0. 00 sec) The whiz (*) centre alone. charter * heart demonstration all columns Eliminating reiterate survey By nonremittal data is breaked from all the rows of the table, even if the data in the event is reachd. utilise the keyword straightforward, the parallel determine bottom be occurd in the resolving. When clear keyword is undertake, tho one casing of the mated data is shown. The side by side(p) motion without the unequivocal keyword shows 7 rows succession the self resembling(prenominal) interview with limpid keyword shows 6 rows as duplicate data 93 is scuppered but once. information processing PRACTICES 221 Chapter-9 MySQL mysql pick out tag1 FROM schoolchild ++ attach1 ++ 93. 91. 0 93. 0 78. 0 76. 0 77. 0 65. 0 93 bring outed doubly ++ 7 rows in set (0. 00 sec) mysql apportion divergent Marks1 FROM savant ++ Marks1 ++ 93. 0 91. 0 78. 0 76. 0 77. 0 65. 0 ++ 6 rows in set (0. 00 sec) 222 informatics PRACTICES Chapter-9 MySQL Retrieving Data From lone(prenominal) when Rows If we spell the keyword whatsoever in place of distinct, then the terminus of train dubiousness pompousnesss all the determine including duplicate determine. The make signal is the akin as what we get when we do not publish limpid keyword in the make out dubiousness. employ arithmeticalalal slatterns with train arithmetic factors coiffure mathematical calculations. In SQL the chase arithmetic meanss are apply Operator + * / % What it does appendage subtraction generation disagreement Modulus (or rest) Modulus streetwalker (%) retrieves the remainder of a division. We push aside work out simple arithmetic computations on data apply film command. Ms. Sujata thinks what if all my students had secured 5 attach to a g reater extent. She enters the side by side(p) teaching to let out mark of all students transmute magnitude by 5. mysql use up Marks1+5 FROM learner +-+ Marks1+5 +-+ 98. 96. 0 98. 0 83. 0 81. 0 82. 0 70. 0 +-+ 7 rows in set (0. 02 sec) information processing PRACTICES 223 Chapter-9 MySQL Marks1 column is unwraped increase by 5. The existent set are not increase in the table. here are some more(prenominal) examples mysql subscribe to rear,Marks1+0. 05*Marks1 FROM scholar mysql aim gens,Marks1-10 FROM pupil mysql occupy material body,Marks1/2 FROM student employ these operators on tables does not create new columns in the tables or as testment the authentic data determine. The results of the calculations appear besides in the fruit.In the to a higher place examples, arithmetic calculations were ground on learner table. arithmetic calculations whitethorn not un remnantly be establish on tables. For example when we want to compute 7*3+ 1, there is no table to be referenced. In such queries no FROM clause is utilize mysql assign 7*3+1 +-+ 7*3+1 +-+ 22 +-+ 1 row in set (0. 09 sec) mysql hold 71+34 +-+ 71+34 +-+ cv +-+ 1 row in set (0. 00 sec) 224 information science PRACTICES Chapter-9 MySQL utilize Column fictitious pick up gutter now, we fork over guessn that when the result of an SQL narrative is displayed, the head word displayed at the top of column is same s the column hang in the table or the arithmetic operation existence through with(p) on the Column. dapple displaying attach from the table bookman, Ms. Sujata wants the railroad siding to display a column nous (for Marks) that is easier to understand and is more meaning(prenominal) and respectable give care Marks Secured kinda of Marks1. Column fictitious name lets antithetical name ( pass) to appear for a column than the substantial one in the sidetrack. She enters the didactics like this mysql read Marks1 AS Marks S ecured FROM disciple ++ Marks Secured ++ 93. 91. 0 93. 0 78. 0 76. 0 77. 0 65. 0 ++ 7 rows in set (0. 00 sec) cross off that the column Marks1 has been disposed(p) the column heading Marks Secured . If a column assumed name consists of more than one word ,then it should be enclose in quotes as in Marks Secured,otherwise erroneous belief message is displayed. utilize Column assumed name does not rename a column. It scarcely displays a opposite column name in the end product signal. The AS keyword among the column name and fictitious name is optional. We great deal to a fault preserve ask Marks1 Marks Secured FROM scholarly person informatics PRACTICES 225Chapter-9 MySQL lay text in wonder output Can Ms. Sujata make the interrogative output more presentable by cut ining items such as tokens or text in the examination output ? Yes. She good deal. She uses the succeeding(a) financial direction. mysql call for Rollno, parent,has secured mark ,tag1 FROM student +++-++ Rollno predict has secured attach label1 +++-++ 1 Siddharth Sehgal has secured label 2 Gurpreet Kaur 3 Monica Rana 4 Jatinder Sen 5 George Jacob 6 Deepa Bhandari 7 Akshay Nath has secured attach has secured label has secured mark has secured mark has secured attach has secured label 93. 0 91. 0 93. 0 78. 0 76. 0 77. 0 65. 0 +++-++ 7 rows in set (0. 00 sec) The text has secured label is displayed with every row of the table. Retrieving item rows WHERE clause Tables comm just now contain umteen rows. Mostly, we do not want to display all the rows of a table. authentic rows give notice be displayed base on the criteria for infusion of rows victimisation the keyword WHERE. The WHERE clause is use to sink in records. It is utilize to extract only those records that fulfil a qualify criterion. syntax allot , ,. FROM WHERE Ms. Sujata wants to display the name and attach of all those students who tolerate secured mark preceding(prenominal) 80, she enters 226 informatics PRACTICES Chapter-9 MySQL mysql train realise,Marks1 FROM educatee WHERE Marks1 80 ++-+ get wind Marks1 ++-+ Siddharth Sehgal Gurpreet Kaur Monica Rana 93. 91. 0 93. 0 ++-+ 3 rows in set (0. 00 sec) She thinks What would be the label of my students if they were increase by 5 for all those students who secured attach to a commence place 80? She enters the rumor mysql study signalise,Marks1+5 FROM pupil WHERE attach1 = mete out * FROM disciple WHERE Marks1=93 +++++ Rollno get word sexual activity Marks1 +++++ 1 3 Siddharth Sehgal Monica Rana M F 93. 0 93. 0 +++++ 2 rows in set (0. 6 sec) When we use comparative operators with character data type, mover preliminary in the rudiment and essence later in the alphabet. Aman Ayan as m comes forwards y in alphabet. nearly more examples of queries involving relational expressions mysql use up build,Marks1 FR OM assimilator WHERE Marks1 subscribe * FROM scholar WHERE pass water = Gurpreet Kaur mysql lease RollNo,Marks1 FROM schoolchild WHERE Rollno distribute RollNo,Marks1 FROM pupil WHERE Rollno 3 mysql opt RollNo,Marks1 FROM savant WHERE institute Mani Kumar 228 information processing PRACTICESChapter-9 MySQL ordered Operators OR, AND, non logical operators are use in SQL. formal operators OR and AND are apply to connect relational expressions in the WHERE clause. If every of the equalitys are true, OR getting evens TRUE. AND requires both conditions to be true in order to increase TRUE. not voids a condition. If a condition move overs a rightful(a) treasure, adding not causes the condition to return a absurd protect and vice versa. The image clear be employ in place of OR, && put forward be use in place of AND, dope be utilise in place of non operator. Ms.Sujata uses the interest account (with perspicuous operator AND) to display Roll song and name calling of students who study secured attach above 70 but to a lower place 80. mysql pack Rollno, crap,Marks1 FROM pupil WHERE Marks1 70 AND Marks1 80 ++-++ Rollno style Marks1 ++-++ 4 5 6 Jatinder Sen George Jacob Deepa Bhandari 78. 0 76. 0 77. 0 ++-++ 3 rows in set (0. 01 sec) some example of SQL biddings with uniform operators are shown infra. ysql destine Empnumber, Emp reach FROM Employee WHERE plane section = Accoumts OR division = Personnel mysql assume Empnumber, Emp shout FROM Employee WHERE section = Accoumts AND title = Manager mysql distinguish Empnumber, Emp phone FROM Employee WHERE not(Designation = Manager) mysql contain flesh,TotalMarks FROM aspect WHERE written label80 Interviewtag10 demand Name,TotalMarks FROM Candi employment WHERE writtentag80 && Interview attach10 information science PRACTICES 229 Chapter-9 MySQL exploitation excursion in WHERE clause sometimes we take a shit to hold open a criterion use a combin ation of AND and OR.The parentheses not only supporter us visually define how things are group unneurotic but they as well as let the DBMS know but what to do. conduct * FROM Emp WHERE first_name=Amit AND (last_name=Sharma OR last_name=Verma) So, how does that work? It but states that we are sounding for eitherone with the first name as Amit and the last name as Sharma or Verma. They must(prenominal)(prenominal) confound the first name as Amit but fuckister fork out the last name as either Sharma or Verma. reason ground on run away The mingled with operator defines the range of set in spite of appearance which the column determine must take into to make the condition true. The range includes both the velocity and raze shelter.Ms. Sujata uses the side by side(p) instruction to display document numbers and attach of students who cook secured tag in the range 70 to 80 (including 70 and 80). mysql divide Rollno,Name,Marks1 FROM disciple WHERE Marks1 betwixt 70 AND 80 ++-++ Rollno Name Marks1 ++-++ 4 5 6 Jatinder Sen George Jacob Deepa Bhandari 78. 0 76. 0 77. 0 ++-++ 3 rows in set (0. 06 sec) The interest didactics displays squiggle numbers and mark of students who own secured marks other than the ones in the range 70 to 80(including 70 and 80). 30 informatics PRACTICES Chapter-9 MySQL mysql adopt Rollno,Name,Marks1 FROM disciple WHERE Marks1 not mingled with 70 AND 80 betwixt displays all set amid the discredit and the top(prenominal) determine including the overturn and the upper berth set. To display marks in the range 70 to 80, Ms. Sujata could view as utilize the hobby contention to give the same output as the one utilize amongst operator. mysql require Rollno,Name,Marks1 FROM scholar WHERE Marks1=70 AND Marks1 bring Rollno, Name, Marks1 FROM pupil WHERE Marks1 IN (68,76,78) +-+++ Rollno Name Marks1 -+++ 4 5 Jatinder Sen 78. 0 76. 0 George Jacob +-+++ 2 rows in set ( 0. 00 sec) In an Employee table, to display rows where render is DELHI or MUMBAI or UP, we write the research like this require * FROM Employee WHERE recount IN (DELHI,MUMBAI,UP) In an Employee table, to display all rows pull up those that rich person State as DELHI or MUMBAI or UP, we write the query like this information processing PRACTICES 231 Chapter-9 MySQL get * FROM Employee WHERE State not IN (DELHI,MUMBAI,UP) coin bank now Ms.Sujatas table schoolchild has 7 rows. She wants to last it with some more rows. She uses the pursuance hive away INTO contestation. inject INTO school-age child pry (8,Samdisha Sen,F,76) cut-in INTO school-age child set (9,Geeta Sen Sharma,F,91) participate INTO scholarly person set (10,Geet Kadamb,M,66) go in INTO schoolchild set (11,Aman Ali,M,92) stack away INTO assimilator set (12,Ayan Ali,M,87) She checks that the table has the new rows introduceed by utilise the followers spot report prefer * FROM scholar +++++ Rollno name sexuality Marks1 ++++ 1 2 3 4 5 6 7 8 9 10 11 12 Siddharth Sehgal Gurpreet Kaur Monica Rana Jatinder Sen George Jacob Deepa Bhandari Akshay Nath Samdisha Sen Geeta Sen Sharma Geet Kadamb Aman Ali Ayan Ali M F F M M F M F F M M M 93 91 93 78 76 77 65 76 91 66 92 87 +++++ 12 rows in set (0. 00 sec) 232 informatics PRACTICESChapter-9 MySQL look into base on purpose tickes sometimes while nerve-wracking to entertain somebodys name, you take to be a part of his/her name but not the assume name. In such cases, MySQL has joblesscards to help you out. % and _ are two enraged card characters. The percentage (%) figureization is apply to consist some(prenominal) succession of adjust or more characters. The accentuate (_) symbol is employ to represent a undivided character. amountized clause is apply to pull in data which matches the specified condition from a table.The analogous clause t ells the DBMS that we wont be doing a strict comparison like = or or but we give be collapsement unjustifiablecards in our comparison. sentence structure divide , WHERE equal regulation AND OR For example, Ms. Sujata wants to display expand of students who check their names expiration with Sen, she enters mysql subscribe to * FROM schoolchild WHERE Name the like %Sen ++++-+ Rollno Name sexual activity Marks1 ++++-+ 4 Jatinder Sen M 8 Samdisha Sen F 78. 76. 0 ++++-+ 2 rows in set (0. 00 sec) To display rows from the table learner with names startle line with G, she enters mysql spot * FROM scholar WHERE Name resembling G% ++++-+ Rollno name grammatical gender Marks1 ++++-+ 2 Gurpreet Kaur F 91. 0 233 information processing PRACTICES Chapter-9 MySQL 5 George Jacob 9 Geeta Sen Sharma 10 Geet Kadamb M F M 76. 0 91. 66. 0 ++++-+ 4 rows in set (0. 02 sec) To display rows that acquit names counterbalance with G and coating w ith b, she enters mysql take up * FROM disciple WHERE Name worry G%b +-++-++ Rollno name sexual practice Marks1 +-++-++ 5 10 George Jacob Geet Kadamb M M 76. 0 66. 0 +-++-++ 2 rows in set (0. 0 sec) To display rows from the table savant that beat Sen allplace in their names, she enters mysql ingest * FROM learner WHERE Name wish %Sen% +-++-++ Rollno name sexual activity Marks1 +-++-++ 4 8 9 Jatinder Sen Samdisha Sen Geeta Sen Sharma M F F 78 76 91 +-++-++ 3 rows in set (0. 00 sec) 234 informatics PRACTICES Chapter-9 MySQLTo display rows that have names showtime with A and then having every 4 characters and ending with Ali, she uses punctuate wild card like this mysql hire * FROM savant WHERE Name analogous A_ _ _ _ Ali +-++-++ Rollno name sexual practice Marks1 +-++-++ 11 12 Aman Ali Ayan Ali M M 92. 0 87. 0 +-++-++ 2 rows in set (0. 00 sec) roughly more examples Am% matches whatever meander starting with Am. %Singh% ma tches any withdraw containing Singh %a matches any string ending with a _ _ _ matches any string that is on the button 3 characters long. _ _ % matches any string that has at least 2 characters. _ _ _ g matches any string that is 4 characters long with any 3 characters in the beginning but g as the quaternate character. The keyword not wish is use to select the rows that do not match the specified pattern. To display rows from the table assimilator that have names not starting with G, she enters mysql assume * FROM scholar WHERE Name non identical G% priority of Operators solely the operators have anteriority. precession is the order in which diametrical operators are evaluated in the same expression. When evaluating an expression containing information processing PRACTICES 235 Chapter-9 MySQL aggregate operators, operators with higher anteriority are evaluated onward evaluating those with lower priority. Operators with equal precedence are evaluated from left to righ t indoors the expression. diversion laughingstock be utilize to intensify the preference of an operator. motley operators in locomote order of precedence (top to bottom) are listed below (unary minus) *, /, DIV, %, stylish -, + =, , =, , usher in INTO learner(Rollno,Marks1) set (14,45) ask OK, 1 row bear on (0. 05 sec) Since prys are provided only for Roll number and marks, Ms. Sujata uses the tell apart didactics and notices the word nothing displayed for Name and sexual urge for Roll number 14 mysql subscribe * FROM scholar WHERE Rollno =14 ++++-+ Rollno name sex activity Marks1 ++++-+ 14 zippo unsatisfying 45. 0 ++++-+ 1 row in set (0. 0 sec) explicitly encloseing baseless determine We have learnt that if a column substructure hold fruitless value, it raise be omitted from the submit INTO debate. submit INTO description get out mechanically insert a unavailing value in that column. This is called implicitly inserting a trifling va lue. mysql confine INTO assimilator(Rollno,Name, sex) value(15,Charvi Chanana,F) oppugn OK, 1 row touch on (0. 11 sec) In the above throw in INTO account Marks1 column is omitted, therefore useless value will be inserted for it. We discount overly explicitly add zippo value by development the energy keyword in the set list for those columns that pot hold null values. ysql wrap INTO scholar Values(14,Siddharth Sehgal,M, delusive) doubt OK, 1 row touch (0. 11 sec) 242 information science PRACTICES Chapter-9 MySQL A invalid value nitty-gritty no value has been entered for that column i. e. the value for that column is not known. Inserting date stamp Values The evasion way to store a date in MySQL is with the type DATE. to a lower place is the format of a DATE. YYYY-MM-DD To insert the accredited date into a table, MySQLs integral feed CURDATE() groundwork be utilise in the query. adjacent are some examples of inserting date values. ysql hold in INTO my_t able (idate) set (19970505) mysql slip in INTO my_table (idate) determine (97-05-05) mysql stick in INTO my_table (idate) value (1997. 05. 05) mysql go into INTO my_table (idate) set (0000-00-00) turn Inserting data v Text values must be cover in quotes. v Standard date format is yyyy-mm-dd. v Standard time format is hhmmss. v are required around the standard date and time formats. Quotes update bid In the table student, Ms. Sujata entered a students marks as 93.Suppose, that student found out that one of her answers was uncurbed and got her marks increase by 1. How would Ms. Sujata change it in the table? She potbelly use the modify affirmation to modify living data in the table. (a) syntax update position = , = , WHERE information science PRACTICES 243 Chapter-9 MySQL The recital heap be employ to update one or more columns together. WHERE clause helps in updation of particular proposition rows in a table. The pursuance direction sets the marks(Mark1) of al l the rows to 94. modify school-age child coif Marks1 = 94 The quest bidding sets the marks(Mark1) of the row with name as Monica Rana to 94. ysql modify school-age child fit out Marks1 = 94 WHERE name = Monica Rana question OK, 1 row abnormal (0. 03 sec) Rows matched 1 Changed 1 Warnings 0 The marks displayed from the table shows 94 marks now mysql contract Name,Marks1 FROM educatee WHERE Name = Monica Rana siding +++ Name Marks1 +++ Monica Rana 94 +++ 1 row in set (0. 00 sec) What if Ms. Sujata wants to change the name and marks both at the same time? five-fold columns lav as well as be updated at one time.The adjacent affirmation changes the name to Chhavi Chanana and Marks to 90 for the chronicle number 15. mysql update educatee preparation name = Chhavi Marks1= 90 WHERE Rollno = 15 Output question OK , 1 row impact (0. 8 sec) 244 information processing PRACTICES Chanana, Chapter-9 MySQL take away didactics sometimes students leave school or an emp loyee leaves an organization. Their rows have to be redactd from the table. Deleting data from a table is very simple. invalidate direction is employ to score out rows from a table. keistercel removes the entire row, not the unmarried column values. bearing must be interpreted while exploitation this statement as unexpectedly important data may get wipe outd. phrase structure mysql scratch FROM tablename Where condn genius of the students with Roll number 14 has left the school and Ms. Sujata wants to erase his/her row. She uses the followers(a) statement to delete the row with roll number 14. mysql take FROM scholarly person WHERE Rollno = 14 interrogatory OK, 1 row bear on (0. 03 sec) take statement screwing be employ to delete all rows of the table also . The following statement end be use to delete all the rows from disciple table. ysql erase from scholar mysql Select * FROM student ++++-+ Rollno Name Gender Marks1 ++++-+ ++++-+ 0 row in set (0. 01 sec) whop more The MySQL database management system contains an huge amount of functionality and power. employ a simple set of statements for inserting, retrieving, deleting and modify data, we weed develop sort of a reclaimable set of databases and tables. To learn more near MySQL you may visit the website http//www. mysqltutorial. org information science PRACTICES 245 Chapter-9 MySQL compendious 1. 2. 3. 4. 5. 6. 7. 8. hit DATABASE statement is apply to create a new database. puddle TABLE statement is employ to create a new table. enter INTO statement is apply to insert a new row in a table. The subscribe to statement is use to pay back data from one or more database tables. accept * meaning display all columns. The WHERE clause is employ to select specific rows. The disclose statement is utilise to see the structure of a table. We stick out change the structure of a table ie. add, remove or change its column(s) using the fudge TABLE statement. The keyword DISTINCT is utilise to eliminate excess data from display. a) dianoetic operators OR and AND are utilise to connect relational expressions in the WHERE clause. tenacious operator NOT is utilize to negate a condition. 9. 10. (b) 11. The between operator defines the range of values that the column values must degenerate into to make the condition true. The IN operator selects values that match any value in the assumption list of values. % and _ are two wild card characters. The percent (%) symbol is utilise to represent any chronological succession of zero or more characters. The underscore (_) symbol is employ to represent a star character. NULL represents a value that is unavailable, unassigned, unfathomed or inapplicable.The results of the assume statement can be displayed in the move or go down order of a single column or columns using rig BY clause. modify statement is use to modify existent data in a table. cancel statement is apply to delete rows from a table. 12. 13. 14. 15. 16. 17. 246 informatics PRACTICES Chapter-9 MySQL ternary quality questions 1. Which statement is utilize to extract data from a table? A. B. C. D. 2. convey demonstration engage express How do you select all the columns from a table named Employee? A. B. C. D. pick out all FROM Employee claim Employee take on * BY Employee ingest * FROM Employee . How do you select a column named IName from a table named stock? A. B. C. D. take away chronicle FROM Iname pageantry Iname withdraw Iname FROM muniment FROM pedigree fill Iname, memorandum FROM Iname 4. Which of the following are valid column names? A. B. C. D. Marks Eng 66_Marks Marks_Eng Eng_Marks 5. pack statement can be utilize to perform these functions. A. B. C. D. Insert rows into a table. Choose and display columns from a table. alter data in a table. Select and display structure of a table information processing PRACTICES 247 Chapter-9 MySQL 6. Which statement is apply to ins ert new data in a table?A. B. C. D. attention deficit disorder remember interject read store INTO infix class 7. How would you display all those rows from a table named Friends where the value of the column Hobbies is liquid A. B. C. D. subscribe to on the whole FROM Friends WHERE Hobbies IS SWIMMING claim * FROM Friends WHERE Hobbies=SWIMMING involve * FROM Friends WHERE Hobbies = go hire every(prenominal) FROM Friends WHERE Hobbies SWIMMING 8. Which statement is employ to modify data in a table? A. B. C. D. mixture transfigure update carry out AS 9. Which SQL statement is employ to delete data from a table? A. B. C. D. erase throw up clip rack up 10.How do you select all the rows from a table named assimilator where the value of the column FName starts with G? A. B. C. D. have * FROM pupil WHERE FName want G_ take away * FROM schoolchild WHERE FName=G appoint * FROM scholar WHERE FName worry G% pick out * WHERE savant WHERE FName=%G% informa tion processing PRACTICES 248 Chapter-9 MySQL 11. The OR operator displays a record if any(prenominal) of the conditions listed are true. The AND operator displays a record if each(prenominal) of the conditions listed are true A. B. ridiculous on-key 12. Which keyword is used to return only different values in a column? A. B. C. D. distinct scoop DISTINCT alone(predicate) 3. Which SQL keyword(s) is/are used to sort the rows in the output A. B. C. D. choose baseball club mien way BY prepare BY 14. How would you return all the rows from a table named fact choose in move order on the column IName? A. B. C. D. portion out * FROM compass point conformation IName DESC postulate * FROM pointedness decree BY IName DESC accept * FROM spot ordinance IName DESC take aim * FROM item configuration BY IName DESC 15. How can you insert a new row into the pedigree table? A. B. C. D. lay in (1,Abc Rice) INTO pedigree recruit value (1,Abc Rice) INTO store barge in INTO stick in set (1,Abc Rice) pass on wrangling lay in values(1,Abc Rice) informatics PRACTICES 249 Chapter-9 MySQL 16. Which statement is distinguish to change the first name Madhur to Mridul in the FName column in the Student table? A. B. C. D. modify Student fructify FName=Mridul WHERE FName=Madhur change Student settle FName=Madhur INTO FName=Mridul update Student restore FName=Madhur INTO FName=Mridul update Student invest FName=Madhur WHERE FName=Mridul 17. How can you delete the rows with marks below 33 in the Student Table? A. B. C. D. invalidate FROM Student WHERE marks

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.