P. 1
SQL-Queries

SQL-Queries

|Views: 55|Likes:
Published by Amritpal Singh

More info:

Published by: Amritpal Singh on Apr 04, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

04/04/2011

pdf

text

original

SAMPLE DATA: -----------PROGRAMMER : ----------------------------------------------------------------------PNAME DOB DOJ SEX PROF1 PROF2 SALARY ----------------------------------------------------------------------ANAND 21-APR-62 21-APR-92 M PASCAL BASIC

3200 ALTAF 02-JUL-64 13-NOV-90 M CLIPPER COBOL 2800 JULAIMA 31-JAN-68 21-APR-90 M COBOL DBASE 3000 KAMALA 30-OCT-68 2-JAN-92 F DBASE DBASE 2900 MARY 24-JUL-70 1-FEB-91 F ORACLE ORACLE 4500 NELSON 11-SEP-85 11-OCT-89 M DBASE DBASE 2500 PATRIC 10-NOV-65 21-APR-90 M CLIPPER CLIPPER 2800 QUADIR 31-AUG-65 21-APR-91 M c c 3000 RAMESH 3-MAY-67 28-FEB-91 M DBASE DBASE 3200 RESECCA 1-JAN-61 29-DEC-90 M COBOL COBOL 2500 REMITHA 19-APR-70 20-APR-93 F ASSEMBLY ASSEMBLY 3600 REVATHI 2-DEC-69 2-JAN-92 F BASIC BASIC 3700 VIJAYA 14-DEC-65 2-MAY-92 F C C 3500 ----------------------------------------------------------------------STUDIES : ----------------------------------------------------------------------PNAME SPLACE COURSE COST ----------------------------------------------------------------------ANAND SABHARI PGDCA 4500 ALTAF COIT DCA 7200 JULAIMA BITS MCA 22000 KAMALA PRAGATHI DCP 5000 MARY SABHARI PGDCA 4500 NELSON PRAGATHY DAP 6200 PATRIC PRAGATHY DCAP 5200 QUADIR APPLE HDCP 14000 RAMESH SABHARI PGDCA 4500 REBECCA BNRILLIANI DCA&P 11000 REMITHA BDPS DCS 6000 REVATHY SABHARI DAP 5000 VIJAYA BDPS DCA 48000 -----------------------------------------------------------------------

SOFTWARE : PNAME TILTE DEV-IN SCOST DCOST SOLD ------------------------------------------------------------------------------ANAND PARACHITES BASIC 399.95 6000 43 ANAND VIDEOTITLING PACK PASCAL 7500.00 160000 9 JULAINA INVENTORY CONTROL COBBOL 3000 5500 0 KAMALA PAYROLLPACKAGE DBASE 9000 20000 7 MARY FINACIAL ACC S\W ORACLE 18000 85000 4 MARY CODE GENRATOR C 4500 20000 23 PATRIC READ ME C++ 300 1200 84 QUADIR BOMBSAWAY ASSEMBLY 750 5000 11 QUADIR VACCIENES C 1900 3400 21 RAMESH HOTELMENAGEMENT DBASE 12000 3500 4

5.how many programmers have done the PGDCA.display the number of the packages sold by each programmer. 16. 38.how many programmers known either cobol or c. .display the names of those who have done the dap course. language wise. 22. 13. 37.what is the price of the costliest software developed by basic.how many female programmers are there. 15.how many programmers studied at pragathi.display the names and date of birth of all the programmers born in january.display the details of those who know clipper.find out the number of copies which should be sold in order to recover the development cost of each package.display each institute name with number of students. 17. 36. 33.display the details of the software developed by ramesh.display the details of the package who sales crossed the 2000 mark.diaplay the sales cost of the packages developed by the each programmer.who are the programmers who celebrate their birthday's during the current month.display the details of those who don't known clipper. 12. 18.display the average difference between scost and dcost for each language. 30. 11. 19. 27. 24.display the sales values of the packages developed by each programmer. 39. 8.how many packages were developed in dbase. 7. 21.display the lowest course fee. 25. 6. 28.average selling cost and aversge proice per copy.what is highest number of copies sold by a package.cobol or pascal.what is the average salary.display each language name with average development cost. 20. 4. 35.what is the average age of female programmer. 9.how many programmers don't know pascal & c. 23.dispaly the number of packages in each language for which development cost is less than 1000. 31.how many programmers paid 500 to 1000 for their course.how much revenue has been earned through sale of packages developed in c. 32.display the names and ages of all the programmers.how many people draw 2000 to 4000.how many programmers studied at shabari. 2. 29.cobol or pascal.what languages are known by the male programmers.calculate the experience in years of each programmers and display along with the names. 26.find the selling cost average for packages developed in pascal.display the programmer's and their packages. 34. 3.display the details of programmers knowing c.in ascending order. 14.RAMESH DEAL LEE PASCAL 599 4500 73 REMITHA PC UTILITIES C 725 500 51 REMITHA TST HELP ASSEMBLY 2500 6000 6 RAVATHY HOSPITAL MANAGEMENT PASCAL 1100 75000 2 REVATHY QUIZMASTER BASIC 3200 2100 15 VIJAYA ISK EDITOR C 900 700 6 ----------------------------------------------------------------------------- QUERY-I : --------1.what is the average course fee.display the details of packages for which developments case have been recovered. 10.how old is the oldest progremmer.

@22. In which year is the most number programmer born. Which package has the lowest selling cost. Oracle or dBase. Who is the youngest programmer knowing Dbase.Display the details . 3. 18. @29. the package which hasthe highest sales a mount. 12. Display the names of the highest paid programmer of each language. Who is the highest paid C programmer. 21. Who is the highest paid female Cobol programmer. Which institute conducts the above course. Who is the least experienced programmer. Which course has been done by the most of the students.Display the details of those who are drawing the same salary. 15. Display the programmer names and the cheapest package developed by them in each language. 20. Who is the youngest male programmer born in 1965. C++. 4. 19. 33.doesn'tknow C. In which language most of the programmer proficient. How many copies of the package have the least difference between developmen t and selling cost. Which institute has the most number of students. 9.III : ----------------1.Display the details 2. 4. Display the names of the packages which have sold less than the average numb er development cost. Which language was used to develop the most number of packages. Who is the that above programmer. 23. Which prgrammer has developed the highest number of packages. 13. Which institute conducts the costliest course. Which is the costliest course. 17. 27. Which language is known by only one programmer. 8. Display the names of the courses whose fees are within 1000/-. Who is the oldest female programmer who joined in 1992. Which female programmer earning more than 3000/. 10. 32. Which course has below average number of students. display the name of the institute and course which has below average course fee. of the software developed by the male programmers earing m of the packages developed in pascal by female programmers of those programmers who joined before 1990. 3. Display the language use by each programmer to develop the highest selling a nd the lowest selling package. . 28. Which is the costliest package developed in Pascal. Who are the authors of the costlies package. Who are the male programmer earning below the average slary of female progra mmers QUERY . 2. Who is the most experienced male programmer knowing Pascal. 25. 5. Which language was used to develop. In which month did most number of programmer join. 26. 6. 30.Display the details ore than 3000. Who developed the package that has sold the least number of copies. 11. 31. Who are the authors of the packages which have recovered more than double th e development cost. 34. 14. were sold.QUERY-II 1. 16. 7. Which package has the highest development cost. 24. 35. 36.

job.Display the details of the software that was developed in the language that is not the programmer's first proficiency. How many packages were developed by the person who develop the cheapest pack age. List each prof1 with the number of programmer having the prof1 and number of packages developed in prof1? 13.which language has been stated as prof1 by most of the programmers . 20.Display the details of software developed in dbase by male programmers who be long to the institute which most number of programmers studied . How many months will it take for each programmer to recover the cost of the course underwent? 5. How many packages were developed by female programmer earning more than high est paid male programmer? 10.Display the details of the software developed by the male students of sabhar i. 16. Which language listed in Prof1 and prof2 has not been used to developed any package. List the programmer names(from progrmmer table) and the number of packages e ach has developed? . List the programmers(from software table) and the institutes they studies in cluding those who didn't developed any package? 12. 6. How much does the person who developed the highest selling package earn? Wha t course did he/she underdgo? 4. where did he study? 9. 3. of those month of birthh and month of joining are the same ? 21. How many packages were developed by the mast experienced programmer from bdp S? 11. How many packages were developed by student who studied in institute that ch arge the lowest course fee? 8. 8.Display the number of packages number of copies sold and sales value of each p rogrammer . 17.Display the details of the software that was developed in the language that i s neither the first nor the second proficiency of the programmer. 15. What is the average salary for those whose software's sales value is more th an 50000? 7.Display the name .Display the total scost .what is the total cost of the software developed by the programmers by apple.Display the details of the software developed in c by female programmers of PRAGATHI.dob. 13. 7.doj. 12. 9. Which is the costlies package developed by a person with three years experie nce? 6.who are the students who have the same prof2. 19.institute-wise.Display the total cost of the software institute -wise.who are the programmers who joined in the same day. 10.who are the male programmers earing below the average salary of female progra mmers .Display the names of the programmers who have not developed any package. 11.5.Display the names of the packages whose names contain more than one word?: QUERY IV 1. 18.Display the details of the software developed by the male programmers who bel ong to the female programmers born after 1975. In which institute did the person who developed the costliest package study? 2. 14.dcost and amount to be recovered for each programme r for those whose dcost has not yet been recovered .

How many different courses are mentioned in the studies table? 20. Display the isntitute names from the studies table without duplicates? 19. Display the name. find the cost of the software developed by mary? 18. Display the names of programmers whose names contain two occurrences of the letter 'a'? 21. Who are the programmers born on the last day of the month? 27. dob(dd/mon/yy format) for all the programmer without u sing conversion function? 26. What is the average development cost of the package developed in cobol? 25. What is the length of the shortest name in ht programmer table? 24. Display the title. Display the names of programmers whose names contain up to 5 characters? 22.sex. What is the amount paid in salaries of the male programmers who don'tknow co bol? 29. Display the details of those who will be completing two years of service thi s year? 15. List the packages that have not been sold so far? 17. Who are the programmers born on the last day of the month? 28. How many female programmer knowing cobol have more than two years experience ? 23.14. scost and difference between scost and dcost in descendin g order of diffrence? . Calculate the amount to be recovered for those packages whose development co st has not yet recovered? 16.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->