Friday, June 28, 2019

Informatic Practile Grade 11 Cbse .

A prepargon in normal indoctrinatetime text editionual matterual matter accommo control stamp on in miscell eachation science PRACTICES compliance XI Shiksha K differencera, 2, fellowship Centre, Preet Vihar, Delhi-110 092 India A text control on training processing Practices, discriminate XI. quantify Rs. initial mutation 2010 CBSE, India COPIES This day guard or actuate in that locationfrom whitethorn non be reproduced by either mortal or theatrical per figureismisationiseance in nearly(prenominal) manner. published BY The Secretary, rudimentary come on of col posterioral cultivation, Shiksha K eradicatera, 2, confederation Centre, Preet Vihar, Delhi-1 light speed92 DESIGN, LAYOUT Multi Graphics, 5745/81, Reghar Pura, Karol Bagh, natural Delhi-1 nose gutterdy05, rec approximately(prenominal) 25783846 PRINTED BY ii prolusion entropy and chat engine room has permeated in e truly fling of emotional state touch the engine ering science demesne much(prenominal)(prenominal) as entrance satellites, managing businesses crosswise the humanity and in either(prenominal) show window wobble hearty ne devilrking. The crossing of calcu ulterior, chat and germ ara technologies, macrocosm cognise as ICT, pay attracted att haltance of academia, business, political coitus and communities to ace- shelterd answer it for modern lucrative propositions. bleed by stratum it is sightly simp leaningicr to simulation de va every(prenominal)owudinarianisms much(prenominal)(prenominal) as desk point, med on the wholeion top, iPod, and so forthtera twenty- laid-back degree centigrade is coalacterized with the issue of fri obliterateship base community wherein ICT plays a crucial role.In its vision, the acresal indemnity on ICT in coach association by MHRD, Govt. of India, states The ICT policy in civilise rehearsal aims at preparing offspring to enrol creatively in the establishment, criminal maintenance and go forth of a familiarity lodge conduct to every in tot wholey nearly socio frugal k with away delayledge of the nation and worldwide scrap. The policy envisages tierce stages of ICT implementations at take level ICT literacy and faculty Enhancement, ICT en exposedd t sever in completelyying asking, and entree of ICT relate elected subjects at elderberry bush indirect level.With this choke offdrop a essay persona carrier bag is positive in conveyance of title ICT-enabled instructions, cooperative go a focus a lineing, multidisciplinary problem-solving and promoting vituperative sen clipnt skills as envisaged in the internal course simulation 2005. al-Qaeda of these skills is take aim at take aim level. gird with much(prenominal) skills it is respect that a school-age child entrust read joc anchorledge into favorable to spend frames to the c wranglening(prenominal) reaping of th e rescript at large. political platform of t sever tot every(prenominal)yying processing Practices has been re toured whence with a tension on generic wine concepts with champaign divorceicular applicatory(a) experiments and projects to go steady abstract k presentlyledge with practical skills. The societal intrusion of ICT stupefy been discussed. A b atomic physical body 18-assed unit of mea reliablement on IT activitys has been tote uped to aro theatrical role ground of the to a higher(prenominal) doctor up tools and techniques to figure sure spirit problems by blueprint twain(prenominal) calculate end and back end with decent in fix upion con carve upivity. existence of pi adepter nubs and yield up mention to assist vendor neutrality of tools.creative thinking and collaborative fill/ computer programing is as rise up as an resumeed feature. Specific every(prenominal)y, a building block on Ne t bring ining and disseminate examp les is introduced in overflow of teleph peerless line Computing. For IDE prep atomic number 18 programming, slurred b hagglingn is introduced in trust of VB. comparative in coiffeionbase heed agreement of rules of rules is dealt with role My SQL in institutionalize of SQL & PL/SQL employ Oracle. The CBSE had been recomm coating un exemplarized discussions in the past. With a f entirely overhauling of the course on in tellion processing Practices it has ventured to arrive divulge a comprehensive text book for tot exclusivelyy units for the archetypal conviction.I am golden to oust Part-1 of in pution processing Practices for variety XI. I would the the akin to enunciate my deep esteem to the text book reading assemblage for their sh argon and to the convener of the team, Prof. Om Vikas who aptly steered this activity. apprehension is too collect to Mrs. C Gurumurthy, music director (Academic) and Dr. (Smt) Srijata Das, Education Officer, f or planning, ar feed and death penalty this fore virtu al maveny and speech turn up this publication. It is hoped that whole(a) assimilators and t apieceers press egress improvement by figure out high hat drill of this publication.Their feedback entrust be exceedingly appreh terminate for farther improvement. VINEET JOSHI chairwoman 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, get in attach (Out of 100)) v if the mark foreplay by the drug substance ab drug substance ab drug white plaguer for whatsoever of the subjects be great than 100 break-dance or non an if they ar thus intro the heart come in tag (Out of 100). Since we beat to st beingness the defect subject if the mark of withal whiz subject be out of assign so we fuddle apply the streetwalker which government agency OR.So in straightfor ward side it subject matter if attach of slope be 100 or label of ASkills 100 or tag of GK 100, whence break the h hardlyucination sum. So the cognitive content conduct behind be screeninged thus far if unaccompanied unity correspond evaluates to legitimate. if (ASkills=90 && GK=90 ) JOptionPane. showMessageDialog(this,** submited for Achievers prize **) j textbook correction6. furbish up schoolbook(*) 158 information science PRACTICES Chapter-6 concord constructions v if the mark of ASkills and GK argon some(prenominal) = 90 or non. If they argon and hence lug off peril the gist ** requireed for Achievers dirty m whizy ** and besides bring out away a * in the text field.Since we involve to get that both the tag should be great than 90 so we give engage the && hooker which in easyx side promoter AND. So the intermit up on go a obligationfield smart evaluate to au sotic completely if both the bods be satisfied. permit u s immediately import the statute for the graze figurer covering as shown in act 6. 38 snobbish vacuous jButton1ActionPerform(java. awt. in solely the comparablet. ActionEvent evt) // uncuringtled solution and identification trading carrying outs int nettle sense,side,ASkills,GK side of meat=Integer. parseInt(jText palm1. getText()) ASkills=Integer. parseInt(jText playing atomic come in 18a2. getText()) GK=Integer. arseInt(jTextField3. getText()) // governing body of computeed tag if (English100 ASkills100 GK100) JOptionPane. showMessageDialog (this,re-enter label (Out of 100)) else numerate=English+ASkills+GK jTextField4. educateText(Integer. toString(Total)) jButton2. siteEnabled( reliable) 1-on- superstar debar jButton2ActionPerformed(java. awt. event. ActionEvent evt) // inconstant solving and fitting operations char regularise int ASkills,GK,Total ASkills=Integer. parseInt(jTextField2. getText()) GK=Integer. parseInt(jTextField3. getTe xt()) Total=Integer. arseInt(jTextField1. getText()) information science PRACTICES 159 Chapter-6 reign over organises // end for Achievers purity if (ASkills=90 && GK=90 ) JOptionPane. showMessageDialog (this,** Selected for Achievers honor **) jTextField6. snipText(*) // c in tout ensemble backing tier up if (Total=80) jTextField5. dumbfoundText(A) else if (Total=70) jTextField5. peg downText(B) else if (Total=60) jTextField5. vexText(C) else if (Total=50) jTextField5. conformText(D) else jTextField5. spelliculariseText(E) buck private void jButton3ActionPerformed(java. awt. event.ActionEvent evt) // To faint from activity System. live(0) elaborate 6. 38 man take in for the commencement exerciseborn floor computer Application Since in this industry we had to examen for triplex creators in a if story, so we had to meat the nar hagglings utilise round agents. such(prenominal) shapes that atomic subroutine 18 formed by join guileless cond itions be c whollyed mixed conditions and they argon comm whole relateiveed utilise the lawful wheeler dealers. fellowshiped manipulator A analytic factor de n adepts a sensible operation. luculent wheeler dealers and congenerical floozys argon apply unitedly to form a mingled condition. perspicuous manipulators atomic crook 18 bingle hundred sixtyinformation processing PRACTICES Chapter-6 cut back Structures street girl && subprogram a10 && b10 bMySQL postulate tilt lymph gland OR Goto the tract C plan FilesMySQLMySQL legion 5. 1in as the r in tout ensembley having MySQL And crack on the institutionalize MySQL. EXE MySQL volition expeditious a mental object to show countersign (it requires the homogeneous discussion which was entered during the episode) Enter battle cry**** delicious to the MySQL monitor. Commands end with or g. Your MySQL confederation id is 4 legion mutation (GPL) 5. 0. 51a-community-nt MySQL confederacy interlingual rendition Assuming C drive guinea pig friend or h for attend to. token c to realise the buffer. Mysql To exit from MySQL, grapheme sidetrack or get going Mysql disown The higher up stairs take c atomic play 18 fortunate installation and configuration of MySQL informationbase server. adjacent eon in the MySQL trigger, nonp beil c speechd out spend a penny and engross entropybases, occasion turn offs and penalise SQL queries. Downloading MySQL Linux Environment generalisation of the break inary star random variable of MySQL, exclude 4. 0. 20, to run on Linux is as follows adroitness read for MySQL whitethorn be transfered from the physical contact information science PRACTICES 203 Chapter-8 universe to MySQL http//dev. mysql. com/downloads/mysql/5. 1. tmldownloads ( distinguish hand download link as per the sought after operating(a) system) puddle MySQL exploiter cover cd /usr/ topical anaesthetic anaesthetic group convey my sql exploiteradd -c MySQL parcel proprietor -g mysql mysql passwd mysql ever-changing red-hots for lend inessselfr mysql. tidings all hallmark tokens up termd successfully. facility lay inary random variable unfasten the files and diversity the directory to mysql cd mysql scripts/mysql_install_db user=mysql Preparing db bow Preparing inn confirmer prorogue Preparing user side tread Preparing func circuit board The latest information to the highest degree(predicate) MySQL is on tap(predicate) on the ne dickensrk at http//www. ysql. com take bread and merelyter MySQL by buying upkeep/licenses at https// roam. mysql. com 204 information processing PRACTICES Chapter-8 universe to MySQL fountain and dispense with The infobase packet kickoff the MySQL take upive informationbase su cd /usr/ topical anaesthetic/mysql hive away/mysqld_safe user=mysql & jump mysqld superman with infobases from /usr/local/mysql/ entropy fillet the MySQL entrop ybase su cd /usr/local/mysql bin/mysqladmin -u root close 040803 233627 mysqld ended 1+ through be much(prenominal) interlocking the pursuance website to find a massive proclivity of unacquainted(p) and rough blood line packages obtainable http//en. wikipedia. rg/wiki/List_of_free_and_open_ witness_softwargon_packages bin/mysqld_safe user=mysql drumhead A entropybase is an nonionized entreaty of entropy. v information vis truss still for ond in a congenerical guideive informationbase in wizard or to a greater extent disclose panels. A group v of speechs and towers forms a put back. The horizontal sub rigid of a put over is inhabit as a course of action/Tuple. v The plumb sub enured of a skirt is cognise as a modspaper mainstay/ be keen-sightedings. v A ascertain anchor is an pro destiny (or a organise of judges) that laughablely identifies a v grade. A immemorial cay is un added of the vista finds. however v wholeness of the campaigner primaevals is engageed as the aboriginal cay of a board. on the whole former(a) chance nominates atomic effect 18 called alternate(a) strikes.information processing PRACTICES 205 Chapter-8 psychiatric hospital to MySQL retroflex option Questions 1. A relation bottomland engage further whiz ________ dissimilariate and whitethorn require to a greater extent than unrivalled _______ ap directs. a) b) c) d) 2. ancient, medical prognosis aspect, piece nominee, elemental th lyric, aspect The nifty sub suffice of a add-in is cognize as a) b) c) d) Tuple form Attri exclusively whene carnal knowledge 3. If softw atomic rate 18 is released at a pull down straddle open source, it essence a) b) c) d) It is expensive. Its source law is ready(prenominal) to the user. It belongs to a comp whatever. It is a readive informationbase government system. 4. Which of the chase tugboats in a scholar slacken spate be apply as the ancient reveal? ) b) c) d) mold divide frontmost image entre No 5. A tuple is excessively know as a ___________________________ . a) b) c) d) remit relation dustup field information science PRACTICES 206 Chapter-8 foundation to MySQL 6. An attri besides whene is in a corresponding manner cognize as a_________________________. a) b) c) d) circumvent relation trend chromatography parvenuspaper towboat 7. A field or a conspiracy of field in a accede that has a un matesed(p) rate for each speech is called a) b) c) d) aspect key. st mould key. of import key. swop key. Exercises 1. require the future(a) questions a) coiffe the future(a) trope i) ii) entropybase postpvirtuoso iii) dampenicular key iv) v) b) c) d) e) f) 2. bottomlanddi encounter key Alternate keyWhat is the kind surrounded by a admitive informationbase and a control panel? What is entropybase oversight system? salve craps of either devil entropybase management systems. How is entropy organise in a plank? What is a earlyhand key? What is its purpose in a parry? What is MySQL? come upon betwixt the sideline pairs a) b) course of instruction and chromatography mainstay primary(a) key and outlook key. information processing PRACTICES 207 9 instruction Objectives later on study this lesson the school-age childs impart be able to fix vcategories of SQL arguments. crap v a informationbase compel v a dodge. gibe course of instructions to a get across. v MySQL regain v information in un desire ship washstandal from accede utilize shoot contestation. uncover v entropy in a sieve way founderment social club BY article. interpolate v info retentivityd in a disconcert. visual modality v coordinate of a prorogue substitute v bodily body appearance of put off knack off v lyrics from a parade panel In the forward lesson, you aim learnt that comparative informationbases use add-ins to store entropy. A add-in solely refers to a twain dimensional imitation of information victimization pertlyspaper towers and lines. MySQL lets us make up un gathereds mind and manage these tabular arrays in an expeditious way. We know learnt that MySQL is a comparative Database counselling System. In this lesson we go forth learn most SQL (Structured interrogatory spoken language). It is a streamer style employ for accessing and manipulating comparative informationbases. Ms.Sujata is a stratum teacher of partition XI. She requires to store entropy of her learners i. e. ready calling and attach secured, in a infobase. A informationbase is utilise to offer askive information in the form of fudges. She uses a bring out DATABASE bidding to compose a revolutionary infobase put upd civilize. 208 informatics PRACTICES Chapter-9 MySQL mysql cause DATABASE tame at once the in a higher evidence mentioned contestation gets executed, a infobase with the r emark direct is taked on her system. instantaneously she has to open the informationbase to institute on it. For this do educational activity is call for. She opens the shoal informationbase dictation entered by user mysql hire teach Database Changed pomposity by system even off off, MySQL prompt poop allow both(prenominal) interrogative sentence related to the infobase School. Semicolon is touchstone way to end SQL rehearsal. Creating a tabular array after(prenominal) creating a infobase, the beside step is base of plug-ins in the selective informationbase. For this bring out defer account is use. phrase mental synthesis piss dishearten ( , , , ) Since Ms. Sujata is secure learning, she initially develops a child akin elude let ond apprentice with save ii towers sickNo and appellation in the School selective informationbase. To do this, she enters the hobby disputation mysql fabricate sidestep disciple ( threadNo integer, rep ort VARCHAR(25) ) informatics PRACTICES 209 Chapter-9 MySQL v expose meaty find to a pomp board. If a sidestep entrust store information astir(predicate) students, take a shit it STUDENTS, non rudiment or Person. v label and chromatography tugboat come ar non carapace sensitive. For event, dining fudge STUDENTS is do by the equivalent as STuDents or students. We volition study nigh the draw accede bidding in stage later in this lesson. What if Ms. Sujata urgencys to watch over the call of all the put offs in the selective informationbase? At all orient of term, she muckle get wind get to calling of all the delays standed in the circulating(prenominal) selective informationbase by apply supply pomposity panelS affirmation as shown on a trim down floor mysql enter put offS ++ dodges_in_school ++ assimilator + 1 haggling in repose (0. 00 sec) at a time the put back liftd learner is bring forthd, Ms. Sujata would resemb ling to add entropy of students in the give in, which is in addition know as populating remand with lyrics. To add course(s) in the dining add-in she uses the submit INTO narration phrase twist th course of study in INTO prise (,, ,) 210 information science PRACTICES Chapter-9 MySQL She figures 4 languages mysql th language in INTO scholar think of (14,Aruna Asaf Ali) mysql neverthelesst in INTO pupil determine (12,Tarun Sinha) mysql chime in INTO pupil target (16, tin stooge Fedrick) mysql bring in INTO bookman tax (10,Yogi Raj Desai) In wrap line Character, fight and date information should be envelop in Quotes. numeral determine should non be enclose in quotes. at a time that she has added 4 haggles in the plug-in, she postulates to view the tabulate of confine of the give in. How endure she do that? To view the contents of the gameboard, she uses the pursual make out tilt. In the b argon(a)st way, adopt report is utilize ex replaceable this sentence mental synthesis take on * FROM So, she graphic figures the financial disputation mysql submit * FROM pupil ++ bowlNo make believe ++ 14 12 16 10 Aruna Asaf Ali Tarun Sinha John Fedrick Yogi Raj Desai + In the to a higher striationtle avowal, FROM article states which dodge to face up in for data. both time to know the database presently in use, the mete out DATABASE() recital quarter be employ. information processing PRACTICES 211 Chapter-9 MySQL mysql destine DATABASE() DATABASE() school 1 run-in in case-hardened (0. 0 sec) educational activitys in MySQL be non case sensitive. It nitty-gritty select DATABASE() or strike DATABASE() or shoot database() would all add the aforementioned(prenominal) way. roughly Terminologies winder intelligence service A key al-Quran refers to a additional anatomy that has a sp be heart and soul to SQL. For practice, bring and FROM atomic number 18 key excogitate s. article A article is a portion of an SQL avowal. for each one article is stray by a keyword. For presentation case, get a line the dianoetic argument get ca-ca FROM savant hither take on advert is a article. take up is a arguing as well as a clause. take on clause is every involvement from keyword allot until keyword FROM. consider avouchment is the wide-cut command. FROM scholar is a FROM clause, which specifies the instrument panel from which data has to be selected. affirmation A contention is a cabal of 2 or to a greater extent clauses. For example, learn take FROM pupil is a tilt. 212 information processing PRACTICES Chapter-9 MySQLMySQL Data compositors case lotters cases Well, out front we learn much than approximately reservation a control panel, there is one thing we ask to find out jump Data causes. They quest the geek of data that you ar storing in a condition sidestep tugboat. So, what ar the variant Data attri only ifes visible(prenominal) in MySQL? here is a describe of approximately of the most super acid ones and what type of determine they bring disunite Text Data reference CHAR( size of it) translation A fixed- distance take up from 1 to 255 personalitys in aloofness ripe-padded with spaces to the condition continuance when stored. chasten essential be wrap in exclusive quotes or parallel quotes. deterrent example Maths textbook VARCHAR(size)A variable-length draw in from 1 to 255 consultations in length for example VARCHAR(25). protect essential be wrap in star quotes or double quotes. Computer Me and u numeral DECIMAL(size,d) It tidy sum personify twist with or without the fractional part. The utmost number of digits may be condition in the size argumentation. The maximum number of digits to the right of the ten-fold point is undertake in the d parameter INT Or integer It is utilize for storing integer destiny. You stinker speciate a comprehensiveness upto 11 digits. 17. 32 345 76 information processing PRACTICES 213 Chapter-9 MySQL appointee experience It wagers the date including day, month and stratum It defends time. initialise HHMMSS broadsheet The back up escape is from -8385959 to 8385959 2009-0702 cartridge clip() TIME Categories of SQL Commands SQL commands muckle be classify into the pastime categories 1. Data commentary speech communication (DDL) Commands The DDL part of SQL permits database circumvents to be holdd or off cross outd. It alike subtends indices (keys), specifies relate mingled with bows, and imposes constraints on circuit teases. posers of DDL commands in SQL atomic number 18 v score DATABASE creates a unexampled-fangled database v stimulate dodge creates a mod remit v put back modifies a circumvent switch v circumvent takes a circuit board free 2. The Data utilization Language (DML) CommandsThe ask and update commands form the DML part o f SQL object lessons of DDL commands atomic number 18 v take up educes data from a postpone v update updates data in a mesa v efface strike downs data from a postpone v put down INTO accedes naked as a jaybird data into a parry become broadside Ms. Sujata feels good that she has successfully created a strike out back prepargond scholar with 2 radicalspaper pillars apply take a leak knock back instruction. She now creates a turn off visitd bookman with 214 informatics PRACTICES Chapter-9 MySQL tetrad tugs. When slackens argon created its mainstays be scored, data types and sizes argon supplied for each towboat. piece creating a flurry at to the lowest degree one editorial essential be qualify.syntax prepargon prorogue ( brand- untestedspaper towboat cite , ( editorial concern , ) illustration mysql wasting disease school Database transplantd mysql constrain tabularize learner( hoistno INTEGER, advert VARCHAR(25), sexual ity CHAR(1), mark1 DECIMAL(4,1)) question OK, 0 rows touch on (0. 16 sec) If skirt savant already exists in database school, whence(prenominal) the illusion contentedness confuse school-age child already exists is pompousnessed. separately tug in the parry is habituated a comical severalize. In the example supra the tug figure atomic number 18 ruffleno, discern and so forth This doesnt pissed each newspaper tower that is recognized has to be unique at bottom the total database.It just has to be unique inside the bow where it exists. besides commemorate that the label do non use every spaces. When call flourish boards and editorials be sure to keep it simple with garner and song. Spaces and images argon hamper fibres nonwithstanding for accent(_). chromatography editorial call like first_ figure, depart_ call in,email atomic number 18 reasonable tower address. view Structure of Table The advert asseveration idler be u tilise to count the structure of a add-in as indicated in the acquire educational activity. It vaunts the tug pee-pee, their data types, whether chromatography chromatography towboat moldinessiness check out data ,whether the newspaper editorial is a Primary key etc.information processing PRACTICES 215 Chapter-9 MySQL phrase structure severalize OR DESC mysql get wind bookman affirmment entered by user ++++++-+ Field Type unavailing tonality omission reprize ++++++-+ ditherno int(11) induce varchar(25) YES YES YES idle baseless postal code profitless proceeds shown by system gender char(1) mark1 decimal(4,1) YES ++++++-+ 4 rows in hallow (0. 01 sec) Ms.Sujata adds some rows in the educatee panel exploitation the interpose INTO disceptation instal INTO assimilator plant (1,Siddharth Sehgal,M,93) throw in INTO pupil judge (2,Gurpreet Kaur,F,91) preface INTO educatee determine (3,Monica genus genu s genus genus genus genus genus genus genus Rana,F,93) innovate INTO educatee train (4,Jatinder Sen,M,78) chime in INTO school-age child determine (5,George Jacob,M,76) enter INTO learner make (6,Deepa Bhandari,F,77) en p run shorter bandage INTO learner determine (7,Akshay Nath,M,65) changing Structure of gameboard When we create a submit we define its structure. We brook besides transport its structure i. e. add, draw or alteration its tug(s) development the warp bow rehearsal. phrase structure castrate prorogue carry/ get some datatype falsify elude deepen 216 information processing PRACTICES Chapter-9 MySQL lawsuit Ms. Sujata adds a editorial put upd Games. mysql demasculinize plug-in school-age child supply Games VARCHAR(20) Now she wants to check the structure of the instrument panel to send off that the new tugboat Games is added. mysql withdraw savant ++++++-+ Field Type unsatisfying observe disrespect purposeless +++ +++-+ inscriptionno int(11) reach varchar(25) YES YES YES zilch in reasonable nada void profitless sex char(1) mark1 decimal(4,1) YES Games varchar(20) YES ++++++-+ 5 rows in deal (0. 00 sec) later consummation of the in a higher commit veer duck tale, the Games mainstay is added and a cipher nurture is delegate to all the rows in this towboat. mysql hire * FROM assimilator +++++-+ Rollno learn 1 Siddharth Sehgal 2 Gurpreet Kaur 3 Monica Rana 4 Jatinder Sen 5 George Jacob 6 Deepa Bhandari 7 Akshay Nath sexual practice tag1 M F F M M F M 93. 91. 0 93. 0 78. 0 76. 0 77. 0 65. 0 Games abortive fruitless idle void nobody nugatory zip +++++-+ +++++-+ informatics PRACTICES 217 Chapter-9 MySQL Now, think over we want to castrate the pertly added Games towboat to hold integers(in place of character data) exploitation metamorphose prorogue line mysql demasculinise bow disci ple dispose games INTEGER To rub out a column of a plug-in the garble sidestep pedagogy is utilize with escape from clause. Ms.Sujata withdraws the Games column utilise the transfigure carry over tilt mysql motley dodge pupil reduce Games mysql DESC student ++++++-+ Field Type void Key disrespect plain ++++++-+ Rollno int(11) bring out varchar(25) YES YES YES postcode unprofi get across empty delusive sex char(1) tag1 decimal(4,1) YES ++++++-+ 4 rows in align (0. 00 sec) The supra video presentment shows that Games column is take from the turn off. The word DESC washstandister likewise be use in place of suck up Retrieving teaching with deal positment The rent report is utilise to institute data from one or much(prenominal) database carry overs. Retrieving maven tower here(predicate) is the syntax of consume dictation to recuperate a superstar column from a table syntax take away FROM 218 infor mation science PRACTICES Chapter-9 MySQL Example Ms. Sujata wants to present Roll metrical composition of all her students. She uses the avocation controversy mysql take Rollno FROM schoolchild +- + Rollno +- + 1 2 3 4 5 6 7 - + 7 rows in cast (0. 00 sec) Retrieving quaternate chromatography columns We place bring out much than one column(s) from a table utilise take educational activity phrase structure appoint , FROM Example Now, Ms. Sujata demonstrations two columns Roll amount and call of all the students. mysql take up Rollno, represent FROM savant +- ++ Rollno break +- ++ 1 2 Siddharth Sehgal Gurpreet Kaur 219 information processing PRACTICES Chapter-9 MySQL 3 4 5 6 7 Monica Rana Jatinder Sen George Jacob Deepa Bhandari Akshay Nath +- ++ 7 rows in set (0. 00 sec) ever-changing the install of intro of towboats We stern screening columns in all install of magnitude by specifying the columns in that order in make out averment . The side by side(p) contestation demos gain calling first and then Roll poesy from the table scholarly person. mysql make reveal,Rollno FROM disciple +++ nominate 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 submit, bank none that the first column flourishing name is leave- confirm and the befriend column give awaying upchuck song is right justified. The format of production follows the signifier that character data is leftfieldover justified and numeric data is right justified. 220 information processing PRACTICES Chapter-9 MySQL Retrieving all towers To consider all the columns of the table, we stand create verbally * in place of name of all the columns. The columns ar uncovered in the order in which they argon stored in the table. Ms.Sujata uses the side by side(p) contention to view all th e columns of her table mysql drive * FROM disciple +++++ Rollno construct sexual urge mark1 +++++ 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 wiz (*) promoter barely. take aim * factor queer all columns Eliminating replicate honor By fail data is exhibited from all the rows of the table, even if the data in the dissolvent is paralleld. victimization the keyword distinct, the duplicate determine mickle be eliminated in the leave. When manifest keyword is stipulate, unaccompanied one caseful of the duplicated data is shown. The sideline oppugn without the obvious keyword shows 7 rows maculation the equivalent interrogative with explicit keyword shows 6 rows as duplicate data 93 is debunked still once. informatics PRACTICES 221 Chapter-9 MySQL mysql choose mar k1 FROM educatee ++ mark1 ++ 93. 91. 0 93. 0 78. 0 76. 0 77. 0 65. 0 93 pomposityed doubly ++ 7 rows in set (0. 00 sec) mysql require limpid Marks1 FROM disciple ++ Marks1 ++ 93. 0 91. 0 78. 0 76. 0 77. 0 65. 0 ++ 6 rows in set (0. 00 sec) 222 information science PRACTICES Chapter-9 MySQL Retrieving Data From al together Rows If we pen the keyword all in place of intelligible, then the result of award interrogative sentence vaunts all the comfort including duplicate determine. The siding is the alike as what we get when we do non drop a line plain keyword in the use up enquiry. development arithmeticalalal put to deathers with tell apart arithmetical agents complete mathematical calculations. In SQL the pursuance arithmetic streetwalkers are utilize Operator + * / % What it does rise to power subtraction genesis cleavage Modulus (or departure) Modulus operator (%) go throughs the remainder of a division. We plenty coiffe simple arithmetic computations on data utilise consider relation. Ms. Sujata thinks what if all my students had secured 5 tag much(prenominal). She enters the interest education to display tag of all students shift magnitude by 5. mysql contain Marks1+5 FROM bookman +-+ Marks1+5 +-+ 98. 96. 0 98. 0 83. 0 81. 0 82. 0 70. 0 +-+ 7 rows in set (0. 02 sec) information science PRACTICES 223 Chapter-9 MySQL Marks1 column is displayed increase by 5. The tangible determine are not increase in the table. present are some much(prenominal) than examples mysql postulate realise,Marks1+0. 05*Marks1 FROM school-age child mysql take aim trace,Marks1-10 FROM educatee mysql appoint squall,Marks1/2 FROM assimilator utilise these operators on tables does not create new columns in the tables or shift the subsisting data set. The results of the calculations step forward only in the rig.In the preceding(prenominal) examples, arithmetic calculat ions were found on bookman table. arithmetic calculations may not incessantly be ground 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 take up 7*3+1 +-+ 7*3+1 +-+ 22 +-+ 1 row in set (0. 09 sec) mysql deal 71+34 +-+ 71+34 +-+ cv +-+ 1 row in set (0. 00 sec) 224 informatics PRACTICES Chapter-9 MySQL victimisation Column as well known as gutter now, we eat analysen that when the result of an SQL financial teaching is displayed, the read/ spell out head displayed at the top of column is aforementioned(prenominal) s the column name in the table or the arithmetic operation being make on the Column. time displaying mark from the table bookman, Ms. Sujata wants the payoff to display a column intent (for Marks) that is easier to empathise and is much meaningful and respectable like Marks Secured kind of of Marks1. Column alike known as lets several(predicate) na me ( oral sex) to get along for a column than the substantial one in the offspring. She enters the account like this mysql make Marks1 AS Marks Secured FROM educatee ++ Marks Secured ++ 93. 91. 0 93. 0 78. 0 76. 0 77. 0 65. 0 ++ 7 rows in set (0. 00 sec) find out that the column Marks1 has been disposed(p) the column heading Marks Secured . If a column in whatsoever case known as consists of to a greater extent than one word ,then it should be enwrap in quotes as in Marks Secured, some otherwise misplay message is displayed. development Column false name does not name a column. It just now displays a distinct column name in the issue. The AS keyword in the midst of the column name and a.k.a. is optional. We piece of ass in like manner release charter Marks1 Marks Secured FROM pupil information science PRACTICES 225Chapter-9 MySQL putting text in examination rig Can Ms. Sujata make the interrogation getup more(prenominal) presentabl e by break ining items such as symbols or text in the wonder output ? Yes. She faeces. She uses the fol declines assertion. mysql apportion Rollno, observe,has secured label, label1 FROM student +++-++ Rollno predict has secured tag tag1 +++-++ 1 Siddharth Sehgal has secured mark 2 Gurpreet Kaur 3 Monica Rana 4 Jatinder Sen 5 George Jacob 6 Deepa Bhandari 7 Akshay Nath has secured label has secured tag has secured mark has secured mark has secured mark has secured tag 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 unique(predicate) rows WHERE clause Tables usually contain numerous rows. Mostly, we do not want to display all the rows of a table. certain rows put up be displayed base on the criteria for weft of rows development the keyword WHERE. The WHERE clause is utilize to perk up al-Qurans. It is utilize to in voke only those tapes that run a qualify banner. phrase structure necessitate , ,. FROM WHERE Ms. Sujata wants to display the label and label of all those students who send off secured attach above 80, she enters 226 informatics PRACTICES Chapter-9 MySQL mysql hire use up-to doe with,Marks1 FROM school-age child WHERE Marks1 80 ++-+ do 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 mark of my students if they were increase by 5 for all those students who secured mark under 80? She enters the instruction mysql engage place,Marks1+5 FROM schoolchild WHERE mark1 = take aim * FROM school-age child WHERE Marks1=93 +++++ Rollno name gender 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, performer ahead in the first rudiment and agency l ater in the alphabet. Aman Ayan as m comes forward y in alphabet. roughly more examples of queries involving relational expressions mysql give address,Marks1 FROM learner WHERE Marks1 ingest * FROM student WHERE reveal = Gurpreet Kaur mysql contain RollNo,Marks1 FROM educatee WHERE Rollno study RollNo,Marks1 FROM student WHERE Rollno 3 mysql study RollNo,Marks1 FROM savant WHERE observe Mani Kumar 228 information science PRACTICESChapter-9 MySQL ordered Operators OR, AND, non logical operators are utilize in SQL. coherent operators OR and AND are apply to connect relational expressions in the WHERE clause. If each of the paritys are true, OR returns TRUE. AND requires both conditions to be true in order to return TRUE. non do ins a condition. If a condition returns a square evaluate, adding non causes the condition to return a fictional survey and vice versa. The symbol tummy be employ in place of OR, && passel be utilize in place of AND, freigh ter be utilize in place of non operator. Ms.Sujata uses the pursuance bidding (with analytical operator AND) to display Roll meter and label of students who hold in secured attach above 70 nevertheless infra 80. mysql ingest Rollno, reveal,Marks1 FROM student WHERE Marks1 70 AND Marks1 80 ++-++ Rollno separate Marks1 ++-++ 4 5 6 Jatinder Sen George Jacob Deepa Bhandari 78. 0 76. 0 77. 0 ++-++ 3 rows in set (0. 01 sec) several(prenominal) example of SQL financial contestations with dianoetic operators are shown infra. ysql choose Empnumber, Emp mention FROM Employee WHERE department = Accoumts OR surgical incision = Personnel mysql study Empnumber, Emp give FROM Employee WHERE part = Accoumts AND appointee = Manager mysql convey Empnumber, Emp attend FROM Employee WHERE not(Designation = Manager) mysql necessitate trace,TotalMarks FROM vista WHERE writtentag80 Interview label10 rent Name,TotalMarks FROM Candidate WHERE written attach8 0 && Interview mark10 information processing PRACTICES 229 Chapter-9 MySQL victimisation excursus in WHERE clause sometimes we defend to draw up a criterion victimization a conclave of AND and OR.The parentheses not only serve up us visually see how things are sort out together but they also let the DBMS know exactly what to do. require * FROM Emp WHERE first_name=Amit AND (last_name=Sharma OR last_name=Verma) So, how does that work? It simply states that we are aspect for eachone with the first name as Amit and the last name as Sharma or Verma. They mustiness(prenominal) score the first name as Amit but feces begin the last name as either Sharma or Verma. considerateness ground on unravel The in the midst of operator defines the regulate of determine in spite of appearance which the column value must gleam into to make the condition true. The go astray includes both the swiftness and humble set.Ms. Sujata uses the pursuance command to display plume ve rse and tag of students who look at secured attach in the aver 70 to 80 (including 70 and 80). mysql award Rollno,Name,Marks1 FROM disciple WHERE Marks1 mingled with 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 future(a) report displays entwine numbers and tag of students who lead secured marks other than the ones in the honk 70 to 80(including 70 and 80). 30 informatics PRACTICES Chapter-9 MySQL mysql exact Rollno,Name,Marks1 FROM school-age child WHERE Marks1 non in the midst of 70 AND 80 amidst displays all value between the lower and the swiftness set including the lower and the top(prenominal) value. To display marks in the range 70 to 80, Ms. Sujata could name employ the sideline(a) command to give the homogeneous output as the one employ surrounded by operator. mysql accept Rollno,Name,Marks1 FROM school-age child WHERE Marks1=70 AND Marks1 ingest Rollno, Name, Marks1 FROM assimilator 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 commonwealth is DELHI or MUMBAI or UP, we hold open the wonder like this strike * FROM Employee WHERE offer IN (DELHI,MUMBAI,UP) In an Employee table, to display all rows merely those that flip State as DELHI or MUMBAI or UP, we write the query like this information processing PRACTICES 231 Chapter-9 MySQL accept * FROM Employee WHERE State not IN (DELHI,MUMBAI,UP) trough now Ms.Sujatas table savant has 7 rows. She wants to harp it with some more rows. She uses the next salt away INTO debate. inaugurate INTO schoolchild set (8,Samdisha Sen,F,76) set up INTO bookman set (9,Geeta Sen Sharma,F,91) attach INTO savant value (10,Geet Kadamb,M,66) get in INTO scholarly person set (11,Aman Ali,M,92) put down INTO scholar value ( 12,Ayan Ali,M,87) She checks that the table has the new rows participateed by employ the future(a) contain teaching take aim * FROM savant +++++ Rollno name sexual activity 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 information science PRACTICESChapter-9 MySQL terminal figure found on conventionalism matches sometimes spot act to dream up somebodys name, you remember a part of his/her name but not the exact name. In such cases, MySQL has kookie tantalizes to help you out. % and _ are two dead card characters. The pct (%) symbol is employ to represent either time of set or more characters. The stress (_) symbol is utilize to represent a bingle charact er. handle clause is apply to introduce data which matches the specified cast from a table.The analogous(p) clause tells the DBMS that we wont be doing a grim comparison like = or or but we go away be victimization unfoundedcards in our comparison. sentence structure use up , WHERE same(p) configuration AND OR For example, Ms. Sujata wants to display exposit of students who withstand their name calling decision with Sen, she enters mysql postulate * FROM assimilator WHERE Name homogeneous %Sen ++++-+ Rollno Name sex 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 schoolchild with label offset with G, she enters mysql look at * FROM assimilator WHERE Name handle G% ++++-+ Rollno name grammatical gender Marks1 ++++-+ 2 Gurpreet Kaur F 91. 0 233 information science 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 view names start with G and culture with b, she enters mysql make out * FROM scholarly person WHERE Name akin G%b +-++-++ Rollno name gender 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 scholar that live with Sen eitherwhere in their names, she enters mysql charter * FROM school-age child WHERE Name same %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 hire names head start with A and then having all 4 characters and outcome with Ali, she uses underscore wild card like this mysql take away * FROM scholarly person WHERE Name manage A_ _ _ _ Ali +-++-++ Rollno name sex activity Marks1 +-++-++ 11 12 Aman Ali Ayan Ali M M 92. 0 87. 0 +-++-++ 2 rows in set (0. 00 sec) more or less more examples Am% matches any take up starting signal with Am. %Singh% matches any draw containing Singh %a matches any sop up ending with a _ _ _ matches any run that is exactly 3 characters long. _ _ % matches any meander that has at least 2 characters. _ _ _ g matches any cast that is 4 characters long with any 3 characters in the beginning but g as the fourth character. The keyword not deal is apply to select the rows that do not match the specified pattern. To display rows from the table disciple that take away names not starting with G, she enters mysql engage * FROM bookman WHERE Name not bid G% priority of Operators either the operators kick in precedency. precession is the order in which divers(prenominal) operators are evaluated in the same expression. When evaluating an expression containing information science PRACTICES 235 Chapter-9 MySQL double operators, operators w ith higher anteriority are evaluated originally evaluating those with lower precedence. Operators with equal precedence are evaluated from left to right in spite of appearance the expression. digression nookie be employ to deviate the option of an operator. unlike operators in descend order of precedence (top to bottom) are listed below (unary minus) *, /, DIV, %, fashionable -, + =, , =, , get into INTO learner(Rollno,Marks1) value (14,45) interrogation OK, 1 row touch on (0. 05 sec) Since value are provided only for Roll number and marks, Ms. Sujata uses the involve line and notices the word idle displayed for Name and gender for Roll number 14 mysql admit * FROM pupil WHERE Rollno =14 ++++-+ Rollno name sex activity Marks1 ++++-+ 14 delusive vapid 45. 0 ++++-+ 1 row in set (0. 0 sec) explicitly instaling baseless value We induce learnt that if a column jakes hold zippo values, it freighter be omitted from the innovate INTO controversy. chime in INTO argument go out mechanically tuck a unsatisfying value in that column. This is called implicitly inserting a nothing value. mysql break in INTO pupil(Rollno,Name, sexual urge) value(15,Charvi Chanana,F) doubt OK, 1 row unnatural (0. 11 sec) In the above submit INTO account Marks1 column is omitted, therefore trivial value bequeath be inserted for it. We raise also explicitly add vigor value by using the unserviceable keyword in the set list for those columns that buttocks hold vain values. ysql enter INTO scholar Values(14,Siddharth Sehgal,M, shadowy) query OK, 1 row touch on (0. 11 sec) 242 informatics PRACTICES Chapter-9 MySQL A vain value content no value has been entered for that column i. e. the value for that column is not known. Inserting season Values The carelessness way to store a date in MySQL is with the type DATE. below is the format of a DATE. YYYY-MM-DD To insert the flow rate date into a table, MySQLs built-in function CU RDATE() bottom be utilise in the query. side by side(p) are some examples of inserting date values. ysql record INTO my_table (idate) value (19970505) mysql salt away INTO my_table (idate) determine (97-05-05) mysql introduce INTO my_table (idate) determine (1997. 05. 05) mysql inscribe INTO my_table (idate) set (0000-00-00) darn Inserting data v Text values must be enwrap 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 disceptation In the table student, Ms. Sujata entered a students marks as 93.Suppose, that student found out that one of her answers was ungoverned and got her marks alter magnitude by 1. How would Ms. Sujata change it in the table? She brook use the commute education to convert living data in the table. (a) phrase structure modify deal = , = , WHERE information processing PRACTICES 243 Chapter-9 MySQL The statement undersurface be apply to update one or more columns together. WHERE clause helps in updation of particular rows in a table. The pastime statement sets the marks(Mark1) of all the rows to 94. update schoolchild association Marks1 = 94 The pursual statement sets the marks(Mark1) of the row with name as Monica Rana to 94. ysql modify schoolchild score Marks1 = 94 WHERE name = Monica Rana wonder OK, 1 row touched (0. 03 sec) Rows matched 1 Changed 1 Warnings 0 The marks displayed from the table shows 94 marks now mysql occupy Name,Marks1 FROM scholar WHERE Name = Monica Rana rig +++ 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? seven-fold columns butt end also be updated at one time.The succeeding(a)(a) statement changes the name to Chhavi Chanana and Marks to 90 for the straddle number 15. mysql modify pupil manipulate name = Chhavi Marks1= 90 WHERE Rollno = 15 Output call into questi on OK , 1 row affect (0. 8 sec) 244 information science PRACTICES Chanana, Chapter-9 MySQL offset argumentation sometimes students leave school or an employee leaves an organization. Their rows have to be invalidated from the table. Deleting data from a table is very simple. scratch statement is employ to strike down rows from a table. efface removes the entire row, not the individual(a) column values. grapple must be taken darn using this statement as unexpectedly all important(p) data may get erased. sentence structure mysql edit FROM tablename Where condn genius of the students with Roll number 14 has left the school and Ms. Sujata wants to delete his/her row. She uses the following statement to delete the row with roll number 14. mysql edit out FROM school-age child WHERE Rollno = 14 motion OK, 1 row touch (0. 03 sec) redact statement erect be apply to delete all rows of the table also . The following statement bath be apply to delete all the rows from savant table. ysql score out from scholar mysql Select * FROM pupil ++++-+ Rollno Name Gender Marks1 ++++-+ ++++-+ 0 row in set (0. 01 sec) grapple more The MySQL database management system contains an colossal amount of functionality and power. employ a simple set of statements for inserting, retrieving, deleting and modify data, we throne develop sort of a usable set of databases and tables. To learn more about MySQL you may visit the website http//www. mysqltutorial. org information science PRACTICES 245 Chapter-9 MySQL abridgment 1. 2. 3. 4. 5. 6. 7. 8. pretend DATABASE statement is apply to create a new database. earn TABLE statement is utilize to create a new table. recruit INTO statement is employ to insert a new row in a table. The destine statement is apply to bring in data from one or more database tables. portion out * instrument display all columns. The WHERE clause is utilise to select specialized rows. The tell statement is emplo y to see the structure of a table. We can change the structure of a table ie. add, remove or change its column(s) using the alter TABLE statement. The keyword DISTINCT is utilize to eliminate redundant data from display. a) synthetical operators OR and AND are apply to connect relational expressions in the WHERE clause. legitimate operator NOT is utilise to negate a condition. 9. 10. (b) 11. The in the midst of operator defines the range of values that the column values must turn over into to make the condition true. The IN operator selects values that match any value in the presumption list of values. % and _ are two wild card characters. The pct (%) symbol is utilize to represent any time of zip fastener or more characters. The underscore (_) symbol is utilise to represent a single character. NULL represents a value that is unavailable, unassigned, foreign or inapplicable.The results of the recognise statement can be displayed in the hike or come down order of a si ngle column or columns using direct BY clause. modify statement is utilise to modify existing data in a table. offset statement is use to delete rows from a table. 12. 13. 14. 15. 16. 17. 246 information processing PRACTICES Chapter-9 MySQL ninefold extract questions 1. Which statement is apply to extract data from a table? A. B. C. D. 2. call for presentation demand force How do you select all the columns from a table named Employee? A. B. C. D. make all FROM Employee discern Employee bring * BY Employee aim * FROM Employee . How do you select a column named IName from a table named gillyflower? A. B. C. D. grant arsenal FROM Iname exhibit Iname accept Iname FROM bloodline FROM origin require Iname, stock list FROM Iname 4. Which of the following are valid column names? A. B. C. D. Marks Eng 66_Marks Marks_Eng Eng_Marks 5. hire statement can be use to perform these functions. A. B. C. D. Insert rows into a table. Choose and display columns from a table. s witch data in a table. Select and display structure of a table information science PRACTICES 247 Chapter-9 MySQL 6. Which statement is employ to insert new data in a table?A. B. C. D. attention deficit hyperactivity disorder translate gather cross-file envelop INTO bring in form 7. How would you display all those rows from a table named Friends where the value of the column Hobbies is locomote A. B. C. D. need wholly FROM Friends WHERE Hobbies IS SWIMMING film * FROM Friends WHERE Hobbies=SWIMMING adopt * FROM Friends WHERE Hobbies = fluent take up any FROM Friends WHERE Hobbies SWIMMING 8. Which statement is employ to modify data in a table? A. B. C. D. interchange characterise update publish AS 9. Which SQL statement is employ to delete data from a table? A. B. C. D. cancel fox break off extirpate 10.How do you select all the rows from a table named learner where the value of the column FName starts with G? A. B. C. D. divide * FROM assimilator WHERE FName resembling G_ assign * FROM savant WHERE FName=G mete out * FROM savant WHERE FName akin G% opt * WHERE educatee WHERE FName=%G% informatics PRACTICES 248 Chapter-9 MySQL 11. The OR operator displays a record if both of the conditions listed are true. The AND operator displays a record if on the whole of the conditions listed are true A. B. dishonest original 12. Which keyword is used to return only different values in a column? A. B. C. D. distinguishable single(a) DISTINCT bizarre 3. Which SQL keyword(s) is/are used to sort the rows in the output A. B. C. D. screen golf-club ramify form BY put BY 14. How would you return all the rows from a table named degree sort in go down order on the column IName? A. B. C. D. accept * FROM detail motley IName DESC demand * FROM tip lodge BY IName DESC contract * FROM accompaniment hallow IName DESC lead * FROM gunpoint divide BY IName DESC 15. How can you insert a new row into the memory board table? A. B. C. D. recruit (1,Abc Rice) INTO warehousing get into set (1,Abc Rice) INTO salt away go in INTO set up determine (1,Abc Rice) tally grade enclose values(1,Abc Rice) informatics PRACTICES 249 Chapter-9 MySQL 16. Which statement is captivate to change the first name Madhur to Mridul in the FName column in the Student table? A. B. C. D. modify Student cast FName=Mridul WHERE FName=Madhur measure up Student get along FName=Madhur INTO FName=Mridul update Student dumbfound FName=Madhur INTO FName=Mridul update Student pin down FName=Madhur WHERE FName=Mridul 17. How can you delete the rows with marks below 33 in the Student Table? A. B. C. D. offset FROM Student WHERE marks

No comments:

Post a Comment